Commit 972604ec authored by Jan Wieck's avatar Jan Wieck

Small fix for ALTER TABLE xxx* ADD COLUMN ...

Inherited child tables must not be open during creation of TOAST table

Jan
parent 93e1f5de
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.85 2000/07/05 13:22:23 wieck Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.86 2000/07/05 13:50:59 wieck Exp $
* *
* NOTES * NOTES
* The PerformAddAttribute() code, like most of the relation * The PerformAddAttribute() code, like most of the relation
...@@ -340,13 +340,17 @@ AlterTableAddColumn(const char *relationName, ...@@ -340,13 +340,17 @@ AlterTableAddColumn(const char *relationName,
foreach(child, children) foreach(child, children)
{ {
Oid childrelid = lfirsti(child); Oid childrelid = lfirsti(child);
char *childrelname;
if (childrelid == myrelid) if (childrelid == myrelid)
continue; continue;
rel = heap_open(childrelid, AccessExclusiveLock); rel = heap_open(childrelid, AccessExclusiveLock);
AlterTableAddColumn(RelationGetRelationName(rel), childrelname = pstrdup(RelationGetRelationName(rel));
false, colDef);
heap_close(rel, AccessExclusiveLock); heap_close(rel, AccessExclusiveLock);
AlterTableAddColumn(childrelname, false, colDef);
pfree(childrelname);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment