Re: GUC flags

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, pgsql-hackers@lists.postgresql.org, bruce@momjian.us, tgl@sss.pgh.pa.us
Date: 2022-02-08T01:44:07Z
Lists: pgsql-hackers

Attachments

On Sun, Feb 06, 2022 at 09:04:14PM -0600, Justin Pryzby wrote:
> Your test is checking that stuff in sample.conf is actually a GUC and not
> marked NOT_IN_SAMPLE.  But those are both unlikely mistakes to make.

Yeah, you are right.  Still, I don't see any reason to not include both.

> I'd first parse the GUC-like lines in the file, making a list of gucs_in_file
> and then compare the two lists.

This is a good idea, and makes the tests faster because there is no
need to test each GUC separately.  While testing a bit more, I got
recalled by the fact that config_file is not marked as NOT_IN_SAMPLE
and not in postgresql.conf.sample, so the new case you suggested was
failing.

What do you think about the updated version attached?  I have applied
the addition of config_data() separately.
--
Michael

Commits

  1. Add TAP test to automate the equivalent of check_guc, take two

  2. Retire src/backend/utils/misc/check_guc

  3. Add TAP test to automate the equivalent of check_guc

  4. Add PostgreSQL::Test::Cluster::config_data()

  5. Introduce pg_settings_get_flags() to find flags associated to a GUC

  6. Revert changes about warnings/errors for placeholders.

  7. Improve the description of various GUCs