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