Re: GUC flags

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, peter(dot)eisentraut(at)enterprisedb(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, bruce(at)momjian(dot)us, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: GUC flags
Date: 2022-01-25 07:25:48
Message-ID: Ye+l/MWw1xu8F4Ac@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 24, 2022 at 07:07:29PM -0600, Justin Pryzby wrote:
> I think you'll find that this is how it's done elsewhere in postgres.
> In the frontend, see appendPQExpBufferChar and appendPGArray and 3e6e86abc.
> On the backend, see: git grep -F "'{'" |grep -w appendStringInfoChar

Yeah, I was not careful enough to look after the uses of TEXTARRAYOID,
and there is one in the same area, as of config_enum_get_options().
At least things are consistent this way.

> I updated the patch with a regex to accommodate GUCs without '=', as needed
> since f47ed79cc8.

Okay. While looking at your proposal, I was thinking that we had
better include the array with the flags by default in pg_settings, and
not just pg_show_all_settings().

+SELECT lower(name) FROM pg_settings_flags WHERE NOT not_in_sample EXCEPT
+SELECT regexp_replace(ln, '^#?([_[:alpha:]]+) (= .*|[^ ]*$)', '\1') AS guc
+FROM (SELECT regexp_split_to_table(pg_read_file('postgresql.conf'),
'\n') AS ln) conf

Tests reading postgresql.conf would break on instances started with a
custom config_file provided by a command line, no? You could change
the patch to use the value provided by the GUC, instead, but I am not
convinced that we need that at all, even if check_guc does so.

Regarding the tests, I am not sure if we need to be this much
extensive. We could take is slow, and I am also wondering if this
could not cause some issues with GUCs loaded via
shared_preload_libraries if we are too picky about the requirements,
as this could cause installcheck failures.

The following things have been issues recently, though, and they look
sensible enough to have checks for:
- GUC_NOT_IN_SAMPLE with developer options.
- Query-tuning parameters with GUC_EXPLAIN, and we'd better add some
comments in the test to explain why there are exceptions like
default_statistics_target.
- preset parameters marked as runtime-computed.
- NO_SHOW_ALL and NOT_IN_SAMPLE.

Thanks,
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Pyhalov 2022-01-25 07:56:12 Foreign join search stops on the first try
Previous Message David Rowley 2022-01-25 07:03:07 Re: Fix BUG #17335: Duplicate result rows in Gather node