pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Postgres hackers <pgsql-hackers@postgresql.org>
Subject: Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs
Date: Thu, 11 Jan 2018 10:42:38 -0500
Message-ID: <13647.1515685358@sss.pgh.pa.us> (raw)
In-Reply-To: <20180111064900.GA51030@paquier.xyz>
References: <20180111064900.GA51030@paquier.xyz>

Michael Paquier <michael.paquier@gmail.com> writes:
> While reviewing another patch related to the use of pg_strcasecmp in the
> backend, I have noticed this bit in ruleutils.c:

>     /*
>      * Some GUC variable names are 'LIST' type and hence must not
>      * be quoted.
>      */
>     if (pg_strcasecmp(configitem, "DateStyle") == 0
>         || pg_strcasecmp(configitem, "search_path") == 0)
>         appendStringInfoString(&buf, pos);
>     else
>         simple_quote_literal(&buf, pos);

> However this fails to consider all GUCs marked as GUC_LIST_INPUT, like
> the recent wal_consistency_checking.

Mmm, yeah, probably time to find a more maintainable solution to that.

> guc.c already holds a find_option()
> which can be used to retrieve the flags of a parameter. What about using
> that and filtering by GUC_LIST_INPUT? This requires exposing the
> function, and I am not sure what people think about that.

Don't like exposing find_option directly, but I think it would make
sense to provide an API along the lines of
int GetConfigOptionFlags(const char *name, bool missing_ok).

			regards, tom lane




view thread (35+ messages)  latest in thread

Message-ID: <13647.1515685358@sss.pgh.pa.us>
Permalink:  ../13647.1515685358@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13647.1515685358@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael.paquier@gmail.com
  Subject: Re: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs
  In-Reply-To: <13647.1515685358@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox