mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03:00
Forbid ALTER TABLE and CLUSTER when there are pending AFTER-trigger events
in the current backend for the target table. These operations move tuples around and would thus invalidate the TIDs stored in the trigger event records. (We need not worry about events in other backends, since acquiring exclusive lock should be enough to ensure there aren't any.) It might be sufficient to forbid only the table-rewriting variants of ALTER TABLE, but in the absence of any compelling use-case, let's just be safe and simple. Per follow-on investigation of bug #3847, though this is not actually the same problem reported therein. Possibly this should be back-patched, but since the case has never been reported from the field, I didn't bother.
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/commands/trigger.h,v 1.65 2008/01/01 19:45:57 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/commands/trigger.h,v 1.66 2008/01/02 23:34:42 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -149,7 +149,7 @@ extern void AfterTriggerEndXact(bool isCommit);
|
||||
extern void AfterTriggerBeginSubXact(void);
|
||||
extern void AfterTriggerEndSubXact(bool isCommit);
|
||||
extern void AfterTriggerSetState(ConstraintsSetStmt *stmt);
|
||||
extern void AfterTriggerCheckTruncate(List *relids);
|
||||
extern bool AfterTriggerPendingOnRel(Oid relid);
|
||||
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user