Re: BUG #17415: Unable to use underscore as first character in set_config custom parameter

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Japin Li <japinli@hotmail.com>
Cc: danielpolski@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2022-02-23T15:59:00Z
Lists: pgsql-bugs
Japin Li <japinli@hotmail.com> writes:
> On Wed, 23 Feb 2022 at 16:36, PG Bug reporting form <noreply@postgresql.org> wrote:
>> SELECT set_config('_foo.bar', 'foo', FALSE);
>> ERROR:  invalid configuration parameter name "_foo.bar"
>> DETAIL:  Custom parameter names must be two or more simple identifiers
>> separated by dots.

> According to the comment of valid_custom_variable_name(), the custom variable
> must be two or more identifiers separated dots, and the identifier confirm
> scan.l, see below:
> However, the code in valid_custom_variable_name() doesn't confirm it.

Yeah, it's supposed to match scan.l, so that's an embarrassing
oversight.  Will apply patch.

			regards, tom lane



Commits

  1. Re-allow underscore as first character of custom GUC names.

  2. Tighten up allowed names for custom GUC parameters.