From: hubert depesz lubaczewski <depesz@depesz.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general mailing list <pgsql-general@postgresql.org>
Subject: Re: How to I select value of GUC that has - in its name?
Date: Tue, 9 Feb 2021 16:45:03 +0100
Message-ID: <20210209154502.GA2409@depesz.com> (raw)
In-Reply-To: <d4868bd3-5e42-8dcc-4e40-938140f76009@aklaver.com>
References: <20210209144059.GA21360@depesz.com>
<d4868bd3-5e42-8dcc-4e40-938140f76009@aklaver.com>
On Tue, Feb 09, 2021 at 07:41:02AM -0800, Adrian Klaver wrote:
> The only way I found so far is:
> select setconfig[array_position(setconfig, 'custom.bad-guc=1a')] from
> pg_db_role_setting where setrole = 'aklaver'::regrole;
Yeah, but this will require some parsing if I don't know what the value
is.
Of course, it's not impossible, I can:
with x as (
select unnest(setconfig) as u
from pg_db_role_setting
where setrole = 'depesz'::regrole
)
select regexp_replace(u, '^[^=]*=', '') from x where u like 'custom.bad-guc=%';
but I find it curious that I can set the guc using normal-ish SET, but
can't get it using SHOW or even select current_setting()
depesz
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: depesz@depesz.com, adrian.klaver@aklaver.com
Subject: Re: How to I select value of GUC that has - in its name?
In-Reply-To: <20210209154502.GA2409@depesz.com>
References: <20210209144059.GA21360@depesz.com> <d4868bd3-5e42-8dcc-4e40-938140f76009@aklaver.com> <20210209154502.GA2409@depesz.com>
* 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