Re: EXPLAN redundant options

Поиск
Список
Период
Сортировка
От Euler Taveira
Тема Re: EXPLAN redundant options
Дата
Msg-id 3759a7a7-c8dc-4fe8-8fcf-7a49eac005a8@app.fastmail.com
обсуждение исходный текст
Ответ на Re: EXPLAN redundant options  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
On Thu, May 2, 2024, at 10:36 AM, David G. Johnston wrote:
On Thu, May 2, 2024 at 6:17 AM jian he <jian.universality@gmail.com> wrote:
explain (verbose, verbose off, analyze on, analyze off, analyze on)

I would just update this paragraph to note the last one wins behavior.

"When the option list is surrounded by parentheses, the options can be written in any order.  However, if options are repeated the last one listed is used."

I have no desire to introduce breakage here.  The implemented concept is actually quite common.  The inconsistency with COPY seems like a minor point.  It would influence my green field choice but not enough for changing long-standing behavior.


There is no policy saying we cannot introduce incompatibility changes in major
releases. If you check for "conflicting or redundant options" or
"errorConflictingDefElem", you will notice that various SQL commands prevent
you to inform redundant options. IMO avoid redundant options is a good goal
because (i) it keeps the command short and (b) it doesn't require you to check
all options to figure out what's the current option value. If the application
is already avoiding redundant options for other commands, the probability of
allowing it just for EXPLAIN is low.

postgres=# create database foo with owner = bar owner = xpto;
ERROR:  conflicting or redundant options
LINE 1: create database foo with owner = bar owner = xpto;
                                               ^
postgres=# create user foo with createdb login createdb;
ERROR:  conflicting or redundant options
LINE 1: create user foo with createdb login createdb;
                                            ^


--
Euler Taveira

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Support LIKE with nondeterministic collations
Следующее
От: Tom Lane
Дата:
Сообщение: Re: EXPLAN redundant options