Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9UKa-0005kQ-MU for pgsql-general@arkaria.postgresql.org; Tue, 09 Feb 2021 14:49:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l9UKZ-0002UX-KH for pgsql-general@arkaria.postgresql.org; Tue, 09 Feb 2021 14:49:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9UKZ-0002UQ-D9 for pgsql-general@lists.postgresql.org; Tue, 09 Feb 2021 14:49:31 +0000 Received: from edlsystems.com ([80.68.91.86]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l9UKU-0006Rf-Vg for pgsql-general@lists.postgresql.org; Tue, 09 Feb 2021 14:49:30 +0000 Received: from cpc91230-cmbg18-2-0-cust448.5-4.cable.virginm.net ([82.1.229.193] helo=[192.168.0.2]) by edlsystems.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1l9UKS-0006KL-Dn for pgsql-general@lists.postgresql.org; Tue, 09 Feb 2021 14:49:24 +0000 Subject: Re: How to I select value of GUC that has - in its name? To: pgsql-general@lists.postgresql.org References: <20210209144059.GA21360@depesz.com> From: Edward Macnaghten Message-ID: Date: Tue, 9 Feb 2021 14:49:19 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210209144059.GA21360@depesz.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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