Skip site navigation (1) Skip section navigation (2)

pgsql: Forbid ALTER TABLE and CLUSTER when there are pending

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Forbid ALTER TABLE and CLUSTER when there are pending
Date: 2008-01-02 23:34:42
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Log Message:
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.

Modified Files:
        cluster.c (r1.166 -> r1.167)
        tablecmds.c (r1.238 -> r1.239)
        trigger.c (r1.226 -> r1.227)
        trigger.h (r1.65 -> r1.66)

pgsql-committers by date

Next:From: User MkzDate: 2008-01-03 09:05:11
Subject: pgbouncer - pgbouncer: allow autoconf 2.59
Previous:From: User RlucasDate: 2008-01-02 23:28:17
Subject: aupg - aupg_src: Modified the aupgschema.rowid() types to use SQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group