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 1jPcOp-0007tI-6j for pgsql-bugs@arkaria.postgresql.org; Sat, 18 Apr 2020 01:36:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jPcOm-0006RT-N1 for pgsql-bugs@arkaria.postgresql.org; Sat, 18 Apr 2020 01:36:00 +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 1jPcOm-0006RM-GC for pgsql-bugs@lists.postgresql.org; Sat, 18 Apr 2020 01:36:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jPcOi-0007oc-OJ for pgsql-bugs@lists.postgresql.org; Sat, 18 Apr 2020 01:35:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 03I1ZpsB014103; Fri, 17 Apr 2020 21:35:51 -0400 From: Tom Lane To: "David G. Johnston" cc: tejeswarm@hotmail.com, PostgreSQL mailing lists Subject: Re: BUG #16376: ALTER SYSTEM incorrectly quotes empty list In-reply-to: References: <16376-d2e5e5c8cbed7525@postgresql.org> Comments: In-reply-to "David G. Johnston" message dated "Fri, 17 Apr 2020 15:56:40 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14101.1587173751.1@sss.pgh.pa.us> Date: Fri, 17 Apr 2020 21:35:51 -0400 Message-ID: <14102.1587173751@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Fri, Apr 17, 2020 at 2:21 PM PG Bug reporting form < > noreply@postgresql.org> wrote: >> Some applications set Postgres parameters using GUI(s) Once a value is set >> and deselected later, it issues a SQL >> ALTER SYSTEM set shared_preload_libraries = ''; > Well, its their bug, not ours, given that we specify two valid ways to > accomplish this goal. SET TO DEFAULT, and RESET. Yes, this is *not* a bug, it's acting as designed. That syntax does not result in a zero-length list, it results in a list with one empty-string entry. We have the same behavior with search_path, which is parsed in the same way. (It's somewhat masked for search_path by the decision to ignore entries that correspond to nonexistent schemas.) There are things we might want to do about this. It's somewhat unfortunate that there's no way to set a GUC_LIST_INPUT variable to an empty list in SET (since RESET might not do that, depending on what the default value is). And perhaps we ought to try harder to validate shared_preload_libraries and its ilk when they are set. But I disagree that there's any parsing bug in the case at hand. Another thing that's rather unfortunate is that the syntax is different in postgresql.conf than it is in SQL --- in a config file, setting shared_preload_libraries = '' *does* set it to an empty list. Which may have contributed to the thinko here. But I'm afraid we're a decade or two too late to redefine the config file syntax. regards, tom lane