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 1l9Wl8-0006ox-Tc for pgsql-general@arkaria.postgresql.org; Tue, 09 Feb 2021 17:25:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l9Wl5-0000sg-Lh for pgsql-general@arkaria.postgresql.org; Tue, 09 Feb 2021 17:25:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9Wl5-0000sS-At for pgsql-general@lists.postgresql.org; Tue, 09 Feb 2021 17:25:03 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9Wl1-0001KQ-BC for pgsql-general@postgresql.org; Tue, 09 Feb 2021 17:25:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Reply-To:Message-ID:Subject:Cc:To:Sender:From:Date: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=m/+BbF9Woz4bANgUzyVZsr4hE0A2wCxR7rROZ588qLk=; b=CFe150WJKD8I2ID/N/5iWJVfQ2 dSsO/uYqioTtnekxHNyMY0Y4T8AM64qXC/oSOeqVWoruotzYzbdlQiyMyYfT0FxSTNnR9ff8E55bd Msbrk2r3qcbQelO2ztB0qn2izWmRtwal4agWiT4bcXqq8x39GJpp27JuQeUlCXCWy1HA=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1l9Wkv-0002Qz-Te; Tue, 09 Feb 2021 18:24:53 +0100 Date: Tue, 9 Feb 2021 18:24:53 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Tom Lane Cc: Adrian Klaver , pgsql-general mailing list Subject: Re: How to I select value of GUC that has - in its name? Message-ID: <20210209172453.GA29679@depesz.com> Reply-To: depesz@depesz.com References: <20210209144059.GA21360@depesz.com> <20210209154502.GA2409@depesz.com> <0564844d-4dda-9162-13b5-4c95c4340e95@aklaver.com> <866534.1612890042@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <866534.1612890042@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > Sure enough, > regression=> show custom."bad-guc"; > ERROR: unrecognized configuration parameter "custom.bad-guc" > regression=> show custom."bad_guc"; > custom.bad_guc > ---------------- > 1a > (1 row) > So that's where the setting went. Oh, that's interesting. Unfortuantley it can also lead to problems: alter user depesz set custom.bad_guc='2b'; $ select * from pg_db_role_setting where setrole = 'depesz'::regrole; setdatabase │ setrole │ setconfig ─────────────┼─────────┼─────────────────────────────────────────────────────────────────────────── 0 │ 16384 │ {application_name=xxx,custom.guc=123,custom.bad-guc=1a,custom.bad_guc=2b} (1 row) And now I can get: $ show custom."bad_guc"; custom.bad_guc ──────────────── 2b (1 row) But the bad-guc is no longer available. > (Fortunately, ALTER USER SET with a custom GUC is superuser-only, > so there's no need to worry about security issues here. But we > should eliminate surprises.) Yeah. Realistically I wouldn't use variable names with - in them, but some people clearly are trying. Thanks, and best regards, depesz