From: Michael Paquier <michael@paquier.xyz>
To: Bossart, Nathan <bossartn@amazon.com>
Cc: Vik Fearing <vik@postgresfriends.org>
Cc: postgresql@zr40.nl <postgresql@zr40.nl>
Cc: Alexander Korotkov <aekorotkov@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable
Date: Wed, 13 Oct 2021 12:42:00 +0900
Message-ID: <YWZViGJFJkrgBKwk@paquier.xyz> (raw)
In-Reply-To: <E29EF33B-CA1A-4146-BFCF-C8EC08FB91A8@amazon.com>
References: <17220-15d684c6c2171a83@postgresql.org>
<9b91d241-4d05-e5a4-67da-5b8acdb9a2f1@postgresfriends.org>
<E29EF33B-CA1A-4146-BFCF-C8EC08FB91A8@amazon.com>
On Wed, Oct 13, 2021 at 12:06:32AM +0000, Bossart, Nathan wrote:
> At first glance, it looks like ALTER INDEX .. ALTER COLUMN ... SET
> uses the wrong validation function. I've attached a patch where I've
> attempted to fix that and added some tests.
The gap is larger than than, because ALTER INDEX .. ALTER COLUMN
.. SET is supported by the parser but we don't document it. The only
thing we document now is SET STATISTICS that applies to a column
*number*.
Anyway, specifying a column name for an ALTER INDEX is not right, no?
Just take for example the case of an expression which has a hardcoded
column name in pg_attribute. So these are not specific to indexes,
which is why we apply column numbers for the statistics case. I think
that we'd better just reject those cases until there is a proper
design done here. As far as I can see, I guess that we should do
things similarly to what we do for SET STATISTICS with column
numbers when it comes to indexes.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, bossartn@amazon.com, vik@postgresfriends.org, postgresql@zr40.nl, aekorotkov@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable
In-Reply-To: <YWZViGJFJkrgBKwk@paquier.xyz>
* 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