Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable
От | Bossart, Nathan |
---|---|
Тема | Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable |
Дата | |
Msg-id | 678CF71A-934B-4FD0-BF63-E41D795E41C9@amazon.com обсуждение исходный текст |
Ответ на | Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable (Dilip Kumar <dilipbalaut@gmail.com>) |
Ответы |
Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable
|
Список | pgsql-hackers |
On 10/13/21, 1:31 AM, "Dilip Kumar" <dilipbalaut@gmail.com> wrote: > On Wed, Oct 13, 2021 at 9:12 AM Michael Paquier <michael@paquier.xyz> wrote: >> 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. > > +1 it should behave similarly to SET STATISTICS for the index and if > someone tries to set with the column name then it should throw an > error. Good point. I agree that rejecting this case is probably the best option for now. In addition to the bug mentioned in this thread, this functionality doesn't even work for supported options currently. postgres=> create table test (a tsvector); CREATE TABLE postgres=> create index on test using gist (a); CREATE INDEX postgres=> alter index test_a_idx alter column a set (siglen = 100); ERROR: unrecognized parameter "siglen" AFAICT the fact that these commands can succeed at all seems to be unintentional, and I wonder if modifying these options requires extra steps such as rebuilding the index. I've attached new patch that just adds an ERROR. Nathan
Вложения
В списке pgsql-hackers по дате отправления: