pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: tejeswarm@hotmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16376: ALTER SYSTEM incorrectly quotes empty list
Date: Fri, 17 Apr 2020 21:35:51 -0400
Message-ID: <14102.1587173751@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwan41enUBi+Pwb9X5D-L0JVGxBkuYnfiOa3Te5WJVy1hA@mail.gmail.com>
References: <16376-d2e5e5c8cbed7525@postgresql.org>
	<CAKFQuwan41enUBi+Pwb9X5D-L0JVGxBkuYnfiOa3Te5WJVy1hA@mail.gmail.com>

"David G. Johnston" <david.g.johnston@gmail.com> 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





view thread (3+ messages)

Message-ID: <14102.1587173751@sss.pgh.pa.us>
Permalink:  ../14102.1587173751@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14102.1587173751@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16376: ALTER SYSTEM incorrectly quotes empty list
  In-Reply-To: <14102.1587173751@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox