aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/command.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-12-22 23:12:07 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-12-22 23:12:07 +0000
commit90f42847b5ed5ed94a1221695e803d522db257b4 (patch)
treec6f4914e38a84556f93b6e9b3e44b601170fc911 /src/backend/commands/command.c
parent7558da669f0cd5144e87f660e0a3422f61806487 (diff)
downloadpostgresql-90f42847b5ed5ed94a1221695e803d522db257b4.tar.gz
postgresql-90f42847b5ed5ed94a1221695e803d522db257b4.zip
Small cleanup of temp-table handling. Disallow creation of a non-temp
table that inherits from a temp table. Make sure the right things happen if one creates a temp table, creates another temp that inherits from it, then renames the first one. (Previously, system would end up trying to delete the temp tables in the wrong order.)
Diffstat (limited to 'src/backend/commands/command.c')
-rw-r--r--src/backend/commands/command.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/commands/command.c b/src/backend/commands/command.c
index 78a3d5e1a75..035967f9209 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.113 2000/12/05 19:57:55 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.114 2000/12/22 23:12:05 tgl Exp $
*
* NOTES
* The PerformAddAttribute() code, like most of the relation
@@ -1237,10 +1237,9 @@ AlterTableAddConstraint(char *relationName,
int i;
bool found = false;
- if (get_temp_rel_by_username(fkconstraint->pktable_name)!=NULL &&
- get_temp_rel_by_username(relationName)==NULL) {
+ if (is_temp_rel_name(fkconstraint->pktable_name) &&
+ !is_temp_rel_name(relationName))
elog(ERROR, "ALTER TABLE / ADD CONSTRAINT: Unable to reference temporary table from permanent table constraint.");
- }
/*
* Grab an exclusive lock on the pk table, so that someone