File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.260 2008/07/16 16:54:08 momjian Exp $
11
+ * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.261 2008/07/16 19:33:25 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -762,9 +762,6 @@ ExecuteTruncate(TruncateStmt *stmt)
762
762
ResultRelInfo * resultRelInfo ;
763
763
ListCell * cell ;
764
764
765
- /* make list unique */
766
- stmt -> relations = list_union (NIL , stmt -> relations );
767
-
768
765
/*
769
766
* Open, exclusive-lock, and check all the explicitly-specified relations
770
767
*/
@@ -774,6 +771,12 @@ ExecuteTruncate(TruncateStmt *stmt)
774
771
Relation rel ;
775
772
776
773
rel = heap_openrv (rv , AccessExclusiveLock );
774
+ /* don't throw error for "TRUNCATE foo, foo" */
775
+ if (list_member_oid (relids , RelationGetRelid (rel )))
776
+ {
777
+ heap_close (rel , AccessExclusiveLock );
778
+ continue ;
779
+ }
777
780
truncate_check_rel (rel );
778
781
rels = lappend (rels , rel );
779
782
relids = lappend_oid (relids , RelationGetRelid (rel ));
You can’t perform that action at this time.
0 commit comments