Re: Add support for ALTER INDEX .. ALTER [COLUMN] col_num {SET, RESET}
От | Bossart, Nathan |
---|---|
Тема | Re: Add support for ALTER INDEX .. ALTER [COLUMN] col_num {SET, RESET} |
Дата | |
Msg-id | 892A6F07-DD04-4722-ADE3-DAB2F9C1212C@amazon.com обсуждение исходный текст |
Ответ на | Re: Add support for ALTER INDEX .. ALTER [COLUMN] col_num {SET,RESET} (Michael Paquier <michael@paquier.xyz>) |
Ответы |
Re: Add support for ALTER INDEX .. ALTER [COLUMN] col_num {SET, RESET}
|
Список | pgsql-hackers |
On 10/29/21, 2:14 AM, "Michael Paquier" <michael@paquier.xyz> wrote: > By the way, while looking at this area of the code (particularly > tsvector and gist), I was under the impression that it is safe to > assume that we don't particularly need to rebuild the index when > changing its attoptions this way, but I have also the feeling to be > rather naive here. This is my concern as well. I remember seeing some weird errors in the thread that led to fdd8857, and I was able to reproduce it with this new patch. If you apply the following patch for the hstore test, it will begin failing. -- diff --git a/contrib/hstore/expected/hstore.out b/contrib/hstore/expected/hstore.out index 64a3272b9c..a4c78a40c8 100644 --- a/contrib/hstore/expected/hstore.out +++ b/contrib/hstore/expected/hstore.out @@ -1352,6 +1352,7 @@ create index hidx on testhstore using gist(h gist_hstore_ops(siglen=2025)); ERROR: value 2025 out of bounds for option "siglen" DETAIL: Valid values are between "1" and "2024". create index hidx on testhstore using gist(h gist_hstore_ops(siglen=2024)); +alter index hidx alter column 1 set (siglen=100); set enable_seqscan=off; select count(*) from testhstore where h @> 'wait=>NULL'; count diff --git a/contrib/hstore/sql/hstore.sql b/contrib/hstore/sql/hstore.sql index a59db66b0a..5e2a1ec99f 100644 --- a/contrib/hstore/sql/hstore.sql +++ b/contrib/hstore/sql/hstore.sql @@ -308,6 +308,7 @@ drop index hidx; create index hidx on testhstore using gist(h gist_hstore_ops(siglen=0)); create index hidx on testhstore using gist(h gist_hstore_ops(siglen=2025)); create index hidx on testhstore using gist(h gist_hstore_ops(siglen=2024)); +alter index hidx alter column 1 set (siglen=100); set enable_seqscan=off; select count(*) from testhstore where h @> 'wait=>NULL'; -- However, if you add a REINDEX right after the ALTER INDEX command, it will succeed. Nathan
В списке pgsql-hackers по дате отправления: