postgres: reloption ALTER INDEX bug
May. 25th, 2016 06:57 pmIt seems to me that I found a bug in current implementation of reloptions: When you are creating a custom index with it's own reloptions, you have no ways to prevent it from changing using ALTER INDEX .... SET (op=value);
For example if you do for bloom index
postgres will successfully run this, change the value of reloptions attribute in pg_class, and bloom index will work wrong after it.
And there is no way to forbid this from inside of an extension.
I think I would add there a flag in reloption descriptor that will tell whether it is allowed to change this reloption using ALTER INDEX, or not
For example if you do for bloom index
alter index bloomidx set ( length=15 );
postgres will successfully run this, change the value of reloptions attribute in pg_class, and bloom index will work wrong after it.
And there is no way to forbid this from inside of an extension.
I think I would add there a flag in reloption descriptor that will tell whether it is allowed to change this reloption using ALTER INDEX, or not
no subject
Date: 2016-05-25 11:21 pm (UTC)no subject
Date: 2016-05-26 02:00 am (UTC)no subject
Date: 2016-05-26 02:04 am (UTC)no subject
Date: 2016-05-26 10:17 am (UTC)Now in the ALTER INDEX code there is no tools for rebuilding index now. (There is one in ALTER COLUMN, but they are in different parts of the code). Adding it there will take some amount of work, and I do not think worth it. ALTERing INDEX is a manual and quite rare operation. User can easily create a new index and delete an old one.
But we must prevent user from changing option that will lead to index misfunction. That is why I am speaking about forbidding changing such options.
no subject
Date: 2016-05-26 10:18 am (UTC)no subject
Date: 2016-05-26 10:19 am (UTC)