Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maSA2-0006wc-IL for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Oct 2021 00:30:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1maSA1-0003ax-FC for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Oct 2021 00:30:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maSA1-0003ap-7s for pgsql-hackers@lists.postgresql.org; Wed, 13 Oct 2021 00:30:21 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maS9u-0002Xp-58 for pgsql-hackers@postgresql.org; Wed, 13 Oct 2021 00:30:20 +0000 Received: (Authenticated sender: vik@postgresfriends.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 0715260007; Wed, 13 Oct 2021 00:30:09 +0000 (UTC) Subject: Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable To: "Bossart, Nathan" , "postgresql@zr40.nl" , Alexander Korotkov Cc: "pgsql-hackers@postgresql.org" References: <17220-15d684c6c2171a83@postgresql.org> <9b91d241-4d05-e5a4-67da-5b8acdb9a2f1@postgresfriends.org> From: Vik Fearing Message-ID: <706b30e0-2bfc-7e1c-6149-a36ff7a5096a@postgresfriends.org> Date: Wed, 13 Oct 2021 02:30:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/13/21 2:06 AM, Bossart, Nathan wrote: > On 10/11/21, 11:03 AM, "Vik Fearing" 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 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