Re: GUC flags
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, peter.eisentraut@enterprisedb.com, pgsql-hackers@lists.postgresql.org, bruce@momjian.us, tgl@sss.pgh.pa.us
Date: 2022-01-25T01:07:29Z
Lists: pgsql-hackers
Attachments
On Wed, Jan 05, 2022 at 11:36:41PM -0600, Justin Pryzby wrote:
> On Thu, Jan 06, 2022 at 02:19:08PM +0900, Michael Paquier wrote:
> > > + initStringInfo(&ret);
> > > + appendStringInfoChar(&ret, '{');
> > > +
> > > + if (flags & GUC_NO_SHOW_ALL)
> > > + appendStringInfo(&ret, "NO_SHOW_ALL,");
> > > + if (flags & GUC_NO_RESET_ALL)
> > > + appendStringInfo(&ret, "NO_RESET_ALL,");
> > > + if (flags & GUC_NOT_IN_SAMPLE)
> > > + appendStringInfo(&ret, "NOT_IN_SAMPLE,");
> > > + if (flags & GUC_EXPLAIN)
> > > + appendStringInfo(&ret, "EXPLAIN,");
> > > + if (flags & GUC_RUNTIME_COMPUTED)
> > > + appendStringInfo(&ret, "RUNTIME_COMPUTED,");
> > > +
> > > + /* Remove trailing comma, if any */
> > > + if (ret.len > 1)
> > > + ret.data[--ret.len] = '\0';
> >
> > The way of building the text array is incorrect here. See
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
I updated the patch with a regex to accommodate GUCs without '=', as needed
since f47ed79cc8.
--
Justin
Commits
-
Add TAP test to automate the equivalent of check_guc, take two
- 7265dbffad7f 15.0 landed
-
Retire src/backend/utils/misc/check_guc
- cf29a11ef646 15.0 landed
-
Add TAP test to automate the equivalent of check_guc
- b0a55f4d4ad5 15.0 landed
-
Add PostgreSQL::Test::Cluster::config_data()
- ba15f16107be 15.0 landed
-
Introduce pg_settings_get_flags() to find flags associated to a GUC
- d10e41d4238e 15.0 landed
-
Revert changes about warnings/errors for placeholders.
- cab5b9ab2c06 15.0 cited
-
Improve the description of various GUCs
- 03774f9bb304 15.0 landed