Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uuEdj-005KWH-2o for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Sep 2025 18:24:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uuEdg-001VPr-V8 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Sep 2025 18:24:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uuEdg-001VPj-MI for pgsql-hackers@lists.postgresql.org; Thu, 04 Sep 2025 18:24:53 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uuEdd-000ZvD-1c for pgsql-hackers@lists.postgresql.org; Thu, 04 Sep 2025 18:24:52 +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 584IOmUT1056072; Thu, 4 Sep 2025 14:24:48 -0400 From: Tom Lane To: Fujii Masao cc: Andrei Klychkov , Jim Jones , pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters In-reply-to: <1046095.1757007639@sss.pgh.pa.us> References: <38091678-2820-4bc8-8df7-b417562f7860@uni-muenster.de> <1046095.1757007639@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 04 Sep 2025 13:40:39 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1056070.1757010288.1@sss.pgh.pa.us> Date: Thu, 04 Sep 2025 14:24:48 -0400 Message-ID: <1056071.1757010288@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > We might want to start resolving this by inventing a syntax for > setting a list GUC to an empty list. I'm not very sure what that > should look like, except that it mustn't be SET ... TO ''. I experimented with the idea of allowing SET var TO ; and got a bunch of shift-reduce conflicts from bison, which don't look easy to avoid. It's probably a bit too surprising anyway. This works from a grammar standpoint: SET var TO NULL; Because NULL is fully reserved, this isn't usurping any cases that weren't syntax errors before. It might still be too surprising. Another idea is that we could redefine a single '' as meaning an empty list if we were to forbid empty strings as members of GUC_LIST_QUOTE variables. This doesn't look like it'd be a big issue for the current set of such variables: local_preload_libraries search_path session_preload_libraries shared_preload_libraries temp_tablespaces unix_socket_directories We might break some applications that're relying on the current behavior that an empty item would be effectively ignored. But that seems a bit remote, and anyway they could just switch to some other nonexistent name. Actually, looking at the small number of GUCs that are marked GUC_LIST_INPUT but not GUC_LIST_QUOTE, I wonder if we shouldn't prohibit empty strings across-the-board for GUC_LIST_INPUT GUCs. I don't see any where it'd be useful to allow them. Then we could allow '' to mean empty list for all of them. regards, tom lane