Re: BUG #16376: ALTER SYSTEM incorrectly quotes empty list

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16376: ALTER SYSTEM incorrectly quotes empty list
Дата
Msg-id 14102.1587173751@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #16376: ALTER SYSTEM incorrectly quotes empty list  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
"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



В списке pgsql-bugs по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #16376: ALTER SYSTEM incorrectly quotes empty list
Следующее
От: David Rowley
Дата:
Сообщение: Re: BUG #16369: Segmentation Faults and Data Corruption withGenerated Columns