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

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>, "postgresql(at)zr40(dot)nl" <postgresql(at)zr40(dot)nl>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable
Date: 2021-10-13 00:30:09
Message-ID: 706b30e0-2bfc-7e1c-6149-a36ff7a5096a@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 10/13/21 2:06 AM, Bossart, Nathan wrote:
> On 10/11/21, 11:03 AM, "Vik Fearing" <vik(at)postgresfriends(dot)org> wrote:
>> On 10/11/21 5:25 PM, PG Bug reporting form wrote:
>>>
>>> User 'musttu' on IRC reported the following bug: After running "ALTER INDEX
>>> some_idx ALTER COLUMN expr SET (n_distinct=100)", the index and table become
>>> unusable. All further statements involving the table result in: "ERROR:
>>> operator class text_ops has no options".
>>>
>>> They reported this on the RDS version of 13.3, but I've been able to
>>> reproduce this on Debian with 13.4 and 14.0. It does not reproduce on 12.8,
>>> all statements succeed on that version.
>>
>> This was broken by 911e702077 (Implement operator class parameters).
>
> Moving to pgsql-hackers(at)(dot)
>
> 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.

Ah, thank you. I was in the (slow) process of writing basically this
exact patch. So I'll stop now and endorse yours.
--
Vik Fearing

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2021-10-13 01:36:08 Re: pg_upgrade test for binary compatibility of core data types
Previous Message Bossart, Nathan 2021-10-13 00:06:32 Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2021-10-13 00:33:19 Re: should we allow users with a predefined role to access pg_backend_memory_contexts view and pg_log_backend_memory_contexts function?
Previous Message Bossart, Nathan 2021-10-13 00:26:47 Re: should we allow users with a predefined role to access pg_backend_memory_contexts view and pg_log_backend_memory_contexts function?