Re: EXPLAN redundant options

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "jian he" <jian(dot)universality(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: EXPLAN redundant options
Date: 2024-05-02 13:58:40
Message-ID: 3759a7a7-c8dc-4fe8-8fcf-7a49eac005a8@app.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)universality(at)gmail(dot)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
EDB https://www.enterprisedb.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-05-02 14:21:09 Re: EXPLAN redundant options
Previous Message Peter Eisentraut 2024-05-02 13:38:32 Re: Support LIKE with nondeterministic collations