Re: How to I select value of GUC that has - in its name? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: How to I select value of GUC that has - in its name?
Date
Msg-id 20210209154502.GA2409@depesz.com
Whole thread Raw
In response to Re: How to I select value of GUC that has - in its name?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: How to I select value of GUC that has - in its name?
List pgsql-general
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



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: How to I select value of GUC that has - in its name?
Next
From: Adrian Klaver
Date:
Subject: Re: How to I select value of GUC that has - in its name?