Commit 6adc255f authored by Hiroshi Inoue's avatar Hiroshi Inoue

Keep relations open until they are no longer needed.

parent 1112a2a0
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.115 2001/01/07 00:05:22 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.116 2001/01/08 03:14:58 inoue Exp $
* *
* NOTES * NOTES
* The PerformAddAttribute() code, like most of the relation * The PerformAddAttribute() code, like most of the relation
...@@ -1195,10 +1195,10 @@ AlterTableAddConstraint(char *relationName, ...@@ -1195,10 +1195,10 @@ AlterTableAddConstraint(char *relationName,
pfree(slot); pfree(slot);
heap_endscan(scan); heap_endscan(scan);
heap_close(rel, NoLock);
if (!successful) if (!successful)
{ {
heap_close(rel, NoLock);
elog(ERROR, "AlterTableAddConstraint: rejected due to CHECK constraint %s", name); elog(ERROR, "AlterTableAddConstraint: rejected due to CHECK constraint %s", name);
} }
/* /*
...@@ -1208,6 +1208,7 @@ AlterTableAddConstraint(char *relationName, ...@@ -1208,6 +1208,7 @@ AlterTableAddConstraint(char *relationName,
* the table. * the table.
*/ */
AddRelationRawConstraints(rel, NIL, constlist); AddRelationRawConstraints(rel, NIL, constlist);
heap_close(rel, NoLock);
pfree(constlist); pfree(constlist);
break; break;
......
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