1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Allow ALTER TYPE .. ADD ATTRIBUTE .. CASCADE to recurse to descendants.

Without this, adding an attribute to a typed table with an inheritance
child fails, which is surprising.

Noah Misch, with minor changes by me.
This commit is contained in:
Robert Haas
2011-04-20 22:49:37 -04:00
parent 8ede427938
commit a0e8df527e
4 changed files with 23 additions and 3 deletions

View File

@ -1344,6 +1344,7 @@ ALTER TYPE test_type1 ALTER ATTRIBUTE b TYPE varchar; -- fails
CREATE TYPE test_type2 AS (a int, b text);
CREATE TABLE test_tbl2 OF test_type2;
CREATE TABLE test_tbl2_subclass () INHERITS (test_tbl2);
\d test_type2
\d test_tbl2
@ -1366,6 +1367,9 @@ ALTER TYPE test_type2 RENAME ATTRIBUTE a TO aa; -- fails
ALTER TYPE test_type2 RENAME ATTRIBUTE a TO aa CASCADE;
\d test_type2
\d test_tbl2
\d test_tbl2_subclass
DROP TABLE test_tbl2_subclass;
CREATE TYPE test_type_empty AS ();
DROP TYPE test_type_empty;