aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/command.c
diff options
context:
space:
mode:
authorJan Wieck <JanWieck@Yahoo.com>2000-07-05 13:50:59 +0000
committerJan Wieck <JanWieck@Yahoo.com>2000-07-05 13:50:59 +0000
commit972604ec60ee950f47d0a722cadaf2fb4b5b71d3 (patch)
tree28fc51a6e9f0b2d2d82573d143413ca3b3607195 /src/backend/commands/command.c
parent93e1f5de0bc45d0ecd77fa0cf642d9e75b7c5fbf (diff)
downloadpostgresql-972604ec60ee950f47d0a722cadaf2fb4b5b71d3.tar.gz
postgresql-972604ec60ee950f47d0a722cadaf2fb4b5b71d3.zip
Small fix for ALTER TABLE xxx* ADD COLUMN ...
Inherited child tables must not be open during creation of TOAST table Jan
Diffstat (limited to 'src/backend/commands/command.c')
-rw-r--r--src/backend/commands/command.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c
index 7c5d4edd8d1..af5c49af5eb 100644
--- a/src/backend/commands/command.c
+++ b/src/backend/commands/command.c
@@ -8,7 +8,7 @@
*
*
* 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
* The PerformAddAttribute() code, like most of the relation
@@ -340,13 +340,17 @@ AlterTableAddColumn(const char *relationName,
foreach(child, children)
{
Oid childrelid = lfirsti(child);
+ char *childrelname;
if (childrelid == myrelid)
continue;
rel = heap_open(childrelid, AccessExclusiveLock);
- AlterTableAddColumn(RelationGetRelationName(rel),
- false, colDef);
+ childrelname = pstrdup(RelationGetRelationName(rel));
heap_close(rel, AccessExclusiveLock);
+
+ AlterTableAddColumn(childrelname, false, colDef);
+
+ pfree(childrelname);
}
}
}