pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Edward Macnaghten <eddy@edlsystems.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: How to I select value of GUC that has - in its name?
Date: Tue, 9 Feb 2021 14:49:19 +0000
Message-ID: <b45a1540-2722-01a1-ba25-17cf0682bfa0@edlsystems.com> (raw)
In-Reply-To: <20210209144059.GA21360@depesz.com>
References: <20210209144059.GA21360@depesz.com>

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






view thread (9+ messages)  latest in thread

Message-ID: <b45a1540-2722-01a1-ba25-17cf0682bfa0@edlsystems.com>
Permalink:  ../b45a1540-2722-01a1-ba25-17cf0682bfa0@edlsystems.com/
Also on:    postgresql.org/message-id/b45a1540-2722-01a1-ba25-17cf0682bfa0@edlsystems.com

 · 

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 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: eddy@edlsystems.com
  Subject: Re: How to I select value of GUC that has - in its name?
  In-Reply-To: <b45a1540-2722-01a1-ba25-17cf0682bfa0@edlsystems.com>
  References: <20210209144059.GA21360@depesz.com> <b45a1540-2722-01a1-ba25-17cf0682bfa0@edlsystems.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