From a0e8df527ec24e8dba98f295c0e2ab6ccf3e5d2c Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 20 Apr 2011 22:49:37 -0400 Subject: 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. --- src/backend/commands/tablecmds.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/tablecmds.c') 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); } } -- cgit v1.2.3