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

From: Edward Macnaghten <eddy(at)edlsystems(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to I select value of GUC that has - in its name?
Date: 2021-02-09 14:49:19
Message-ID: b45a1540-2722-01a1-ba25-17cf0682bfa0@edlsystems.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/02/2021 14:40, hubert depesz lubaczewski wrote:
> Hi,
> question from IRC, but I couldn't find an answer.
>
> I can set custom guc with - in name, but I can't figure out how to
> select it.
>
> Without minus, it works great:
>
> =$ psql -X -c 'show custom.guc'
> ERROR: unrecognized configuration parameter "custom.guc"
>
> =$ psql -X -c "alter user depesz set custom.guc = '123'"
> ALTER ROLE
>
> =$ psql -X -c 'show custom.guc'
> custom.guc
> ------------
> 123
> (1 row)
>
> If I'd try to set variable with - in name:
>
> $ alter user depesz set custom.bad-guc = '1a';
> ERROR: syntax error at or near "-"
> LINE 1: alter user depesz set custom.bad-guc = '1a';

Have you tried enclosing "bad-guc" in double quotes?

Eddy

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-02-09 15:05:05 Re: Increased size of database dump even though LESS consumed storage
Previous Message hubert depesz lubaczewski 2021-02-09 14:40:59 How to I select value of GUC that has - in its name?