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:
@ -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
|
||||
--
|
||||
|
Reference in New Issue
Block a user