Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit582ec17

Browse files
Jan WieckJan Wieck
Jan Wieck
authored and
Jan Wieck
committed
Small bugfix for DROP TABLE if table is self-referenced by
a FOREIGN KEY constraint.Jan
1 parent7932f86 commit582ec17

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/backend/commands/trigger.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.57 2000/02/0418:49:31 wieck Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.58 2000/02/0423:45:04 wieck Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -372,6 +372,13 @@ RelationRemoveTriggers(Relation rel)
372372

373373
heap_endscan(tgscan);
374374

375+
/* ----------
376+
* Need to bump it here so the following doesn't see
377+
* the already deleted triggers again for a self-referencing
378+
* table.
379+
* ----------
380+
*/
381+
CommandCounterIncrement();
375382

376383
/* ----------
377384
* Also drop all constraint triggers referencing this relation
@@ -388,6 +395,7 @@ RelationRemoveTriggers(Relation rel)
388395
DropTrigStmtstmt;
389396

390397
pg_trigger= (Form_pg_trigger)GETSTRUCT(tup);
398+
391399
refrel=heap_open(pg_trigger->tgrelid,NoLock);
392400

393401
stmt.relname=pstrdup(RelationGetRelationName(refrel));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp