diff options
author | Robert Haas <rhaas@postgresql.org> | 2011-04-20 22:49:37 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2011-04-20 22:49:37 -0400 |
commit | a0e8df527ec24e8dba98f295c0e2ab6ccf3e5d2c (patch) | |
tree | 6fe1c2eb71bab3251bdece75b22bd009aaa46577 /src/backend/commands/tablecmds.c | |
parent | 8ede427938e9676d0e497406c213f098303a93f3 (diff) | |
download | postgresql-a0e8df527ec24e8dba98f295c0e2ab6ccf3e5d2c.tar.gz postgresql-a0e8df527ec24e8dba98f295c0e2ab6ccf3e5d2c.zip |
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.
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 26062f45602..bcf660b6de0 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -3876,7 +3876,8 @@ ATSimpleRecursion(List **wqueue, Relation rel, * ATTypedTableRecursion * * Propagate ALTER TYPE operations to the typed tables of that type. - * Also check the RESTRICT/CASCADE behavior. + * Also check the RESTRICT/CASCADE behavior. Given CASCADE, also permit + * recursion to inheritance children of the typed tables. */ static void ATTypedTableRecursion(List **wqueue, Relation rel, AlterTableCmd *cmd, @@ -3898,7 +3899,7 @@ ATTypedTableRecursion(List **wqueue, Relation rel, AlterTableCmd *cmd, childrel = relation_open(childrelid, lockmode); CheckTableNotInUse(childrel, "ALTER TABLE"); - ATPrepCmd(wqueue, childrel, cmd, false, true, lockmode); + ATPrepCmd(wqueue, childrel, cmd, true, true, lockmode); relation_close(childrel, NoLock); } } |