summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHiroshi Inoue <inoue@tpf.co.jp>2001-01-08 03:14:58 +0000
committerHiroshi Inoue <inoue@tpf.co.jp>2001-01-08 03:14:58 +0000
commit6adc255f8aa8017e023685833bca3461422ef226 (patch)
tree95ad2c3710acc09b558752b6c31f4fb0c7dfa632 /src
parent1112a2a0844cf6a2e682cec4696272e90e11a7b1 (diff)
downloadpostgresql-6adc255f8aa8017e023685833bca3461422ef226.tar.gz
Keep relations open until they are no longer needed.
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/command.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c
index d3a00753e5..d1f595eed8 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.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
* The PerformAddAttribute() code, like most of the relation
@@ -1195,10 +1195,10 @@ AlterTableAddConstraint(char *relationName,
pfree(slot);
heap_endscan(scan);
- heap_close(rel, NoLock);
if (!successful)
{
+ heap_close(rel, NoLock);
elog(ERROR, "AlterTableAddConstraint: rejected due to CHECK constraint %s", name);
}
/*
@@ -1208,6 +1208,7 @@ AlterTableAddConstraint(char *relationName,
* the table.
*/
AddRelationRawConstraints(rel, NIL, constlist);
+ heap_close(rel, NoLock);
pfree(constlist);
break;