Re: [PATCH][Documination] Add optional USING keyword before opclass name in INSERT statemet

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nikolay Shaplov <n(dot)shaplov(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH][Documination] Add optional USING keyword before opclass name in INSERT statemet
Date: 2016-05-26 14:05:56
Message-ID: 26587.1464271556@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nikolay Shaplov <n(dot)shaplov(at)postgrespro(dot)ru> writes:
> 24 2016 12:47:20 Tom Lane :
>> I think we should seriously consider fixing this code/docs discrepancy
>> by making the code match the docs, not vice versa. That is, let's just
>> remove the USING alternative here entirely.

> I have two arguments for not removing USING there.

> 1. Backward compatibility. Are you sure, that nobody ever wrote a code using
> this "USING" keyword? I would say it is unlikely, but will not be sure 100%.

I would say the same. However, we make incompatible changes in every
major release, and many of them are way harder to deal with than this.

> 2. I think expression with USING in it is more human readable:
> CREATE INDEX (xxx op_yyy);
> is less sensible then
> CREATE INDEX (xxx USING op_yyy);

Yes. If we were working in a green field, it would have been better to
make USING (or some other reserved word) required, not optional, there.
That would have been better for readability and would have avoided some
syntactic headaches, such as the need to parenthesize the expressions in
expression indexes. However, we're about 18 years too late to make that
decision. Opclass with no introductory keyword is the entrenched standard
at this point, and we're never going to be able to remove it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Seltenreich 2016-05-26 14:07:59 Re: ORDER/GROUP BY expression not found in targetlist
Previous Message David G. Johnston 2016-05-26 13:57:07 Re: [PATCH][Documination] Add optional USING keyword before opclass name in INSERT statemet