Skip to content

Commit dd7c059

Browse files
committed
Re-allow underscore as first character of custom GUC names.
Commit 3db826b intended that valid_custom_variable_name's rules for valid identifiers match those of scan.l. However, I (tgl) had some kind of brain fade and put "_" in the wrong list. Fix by Japin Li, per bug #17415 from Daniel Polski. Discussion: https://postgr.es/m/17415-ebdb683d7e09a51c@postgresql.org
1 parent 627c79a commit dd7c059

File tree

1 file changed

+2
-2
lines changed
  • src/backend/utils/misc

1 file changed

+2
-2
lines changed

src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5390,13 +5390,13 @@ valid_custom_variable_name(const char *name)
53905390
name_start = true;
53915391
}
53925392
else if (strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
5393-
"abcdefghijklmnopqrstuvwxyz", *p) != NULL ||
5393+
"abcdefghijklmnopqrstuvwxyz_", *p) != NULL ||
53945394
IS_HIGHBIT_SET(*p))
53955395
{
53965396
/* okay as first or non-first character */
53975397
name_start = false;
53985398
}
5399-
else if (!name_start && strchr("0123456789_$", *p) != NULL)
5399+
else if (!name_start && strchr("0123456789$", *p) != NULL)
54005400
/* okay as non-first character */ ;
54015401
else
54025402
return false;

0 commit comments

Comments
 (0)