Skip to content

Commit 8de6a24

Browse files
Revert "code changes for SQL query built from user-controlled sources code ql issues"
This reverts commit 0d41d11.
1 parent 9eb021c commit 8de6a24

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

App/kernel-memory/extensions/Postgres/Postgres/PostgresMemory.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,11 @@ private void Dispose(bool disposing)
232232
// Note: "_" is allowed in Postgres, but we normalize it to "-" for consistency with other DBs
233233
private static readonly Regex s_replaceIndexNameCharsRegex = new(@"[\s|\\|/|.|_|:]");
234234
private const string ValidSeparator = "-";
235-
// Only allow 1-63 chars, start with a lowercase letter, then letters, digits, dashes, or underscores.
236-
private static readonly Regex s_validIndexNameRegex = new(@"^[a-z][a-z0-9\-_]{0,62}$", RegexOptions.Compiled);
237235

238236
private static string NormalizeIndexName(string index)
239237
{
240238
ArgumentNullExceptionEx.ThrowIfNullOrWhiteSpace(index, nameof(index), "The index name is empty");
241239
index = s_replaceIndexNameCharsRegex.Replace(index.Trim().ToLowerInvariant(), ValidSeparator);
242-
// Enforce positive validation for safe Postgres identifier.
243-
if (!s_validIndexNameRegex.IsMatch(index))
244-
{
245-
throw new ArgumentException($"Index name '{index}' is invalid. Must match regex: ^[a-z][a-z0-9\\-_]{{0,62}}$");
246-
}
247240

248241
PostgresSchema.ValidateTableName(index);
249242

0 commit comments

Comments
 (0)