Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: Matthijs van der Vleuten <postgresql(at)zr40(dot)nl>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Vik Fearing <vik(at)postgresfriends(dot)org>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable
Date: 2021-10-20 03:47:04
Message-ID: YW+ROCXCtFshHvDx@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Tue, Oct 19, 2021 at 02:40:04PM +0000, Bossart, Nathan wrote:
> On 10/18/21, 11:49 PM, "Matthijs van der Vleuten" <postgresql(at)zr40(dot)nl> wrote:
>> The test case doesn't seem entirely correct to me? The index being
>> dropped (btree_tall_tbl_idx2) doesn't exist.
>
> This was fixed before it was committed [0].

Yes, my apologies about this brain fade. The committed code is
hopefully fine :)

>> Also, I don't believe this tests the case of dropping the index when
>> it previously has been altered in this way.
>
> That can still fail with the "has no options" ERROR, and fixing it
> will still require a manual catalog update. The ERROR is actually
> coming from the call to index_open(), so bypassing it might require
> some rather intrusive changes. Given that it took over a year for
> this bug to be reported, I suspect it might be more trouble than it's
> worth.

This may need a mention in the release notes, but the problem is I
guess not that spread enough to worry or people would have complained
more since 13 was out. Logical dumps discard that automatically and
even for the ANALYZE case, the pre-committed code would have just
ignored the reloptions retrieved by get_attribute_options().
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Verite 2021-10-20 09:21:10 Re: BUG #17235: PQsendQuery (with two sql) after PQenterPipelineMode cause ERROR
Previous Message Tom Lane 2021-10-19 21:58:34 Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-10-20 04:55:05 Re: pgsql: Document XLOG_INCLUDE_XID a little better
Previous Message Michael Paquier 2021-10-20 03:37:35 Re: Fixing build of MSVC with OpenSSL 3.0.0