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 1oUExU-00066W-Q5 for pgsql-docs@arkaria.postgresql.org; Fri, 02 Sep 2022 22:16:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oUExS-0001cb-8u for pgsql-docs@arkaria.postgresql.org; Fri, 02 Sep 2022 22:16:14 +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 1oUExS-0001cH-1M for pgsql-docs@lists.postgresql.org; Fri, 02 Sep 2022 22:16:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUExO-0007CR-Vn for pgsql-docs@lists.postgresql.org; Fri, 02 Sep 2022 22:16:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 282MG9jj1228417; Fri, 2 Sep 2022 18:16:09 -0400 From: Tom Lane To: guyren@relevantlogic.com cc: pgsql-docs@lists.postgresql.org Subject: Re: No discussion of custom variables; no "See also" for set_config, current_setting, pg_settings In-reply-to: <166215027042.1235918.13727650130980574270@wrigleys.postgresql.org> References: <166215027042.1235918.13727650130980574270@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Fri, 02 Sep 2022 20:24:30 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1228415.1662156969.1@sss.pgh.pa.us> Date: Fri, 02 Sep 2022 18:16:09 -0400 Message-ID: <1228416.1662156969@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Doc comments form writes: > A reader of this section > https://www.postgresql.org/docs/current/sql-set.html of the documentation > might be forgiven for thinking that Postgres does not support custom > variables. They are, in fact, *not* a supported feature. The only intended use of non-core GUCs was for extensions' parameters. People have abused the mechanism to create ad-hoc session variables, but we don't encourage it. The underlying code won't scale to large numbers of variables, there's no way to declare properties of such a variable in SQL, etc. There's been an ongoing effort to create a respectable substitute, but it still hasn't gotten across the finish line [1]. regards, tom lane [1] https://commitfest.postgresql.org/39/1608/