aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 29edb61638e..3f9cad16ce4 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.63 2002/12/30 18:42:14 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.64 2002/12/30 19:45:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -423,8 +423,7 @@ TruncateRelation(const RangeVar *relation)
Form_pg_constraint con = (Form_pg_constraint) GETSTRUCT(tuple);
if (con->contype == 'f' && con->conrelid != relid)
- elog(ERROR, "TRUNCATE cannot be used as table %s references "
- "this one via foreign key constraint %s",
+ elog(ERROR, "TRUNCATE cannot be used as table %s references this one via foreign key constraint %s",
get_rel_name(con->conrelid),
NameStr(con->conname));
}
@@ -439,6 +438,11 @@ TruncateRelation(const RangeVar *relation)
rebuild_relation(rel, InvalidOid);
/* NB: rebuild_relation does heap_close() */
+
+ /*
+ * You might think we need to truncate the rel's toast table here too,
+ * but actually we don't; it will have been rebuilt in an empty state.
+ */
}
/*----------