1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Make CheckIndexCompatible simpler and more bullet-proof.

This gives up the "don't rewrite the index" behavior in a couple of
relatively unimportant cases, such as changing between an array type
and an unconstrained domain over that array type, in return for
making this code more future-proof.

Noah Misch
This commit is contained in:
Robert Haas
2012-01-25 15:28:07 -05:00
parent 8366c7803e
commit 6eb71ac552
3 changed files with 67 additions and 55 deletions

View File

@ -1197,6 +1197,14 @@ select reltoastrelid <> 0 as has_toast_table
from pg_class
where oid = 'test_storage'::regclass;
-- SET DATA TYPE without a rewrite
CREATE DOMAIN other_textarr AS text[];
CREATE TABLE norewrite_array(c text[] PRIMARY KEY);
SET client_min_messages = debug1;
ALTER TABLE norewrite_array ALTER c TYPE text[]; -- no work
ALTER TABLE norewrite_array ALTER c TYPE other_textarr; -- rebuild index
RESET client_min_messages;
--
-- lock levels
--