Re: locks in CREATE TRIGGER, ADD FK - Mailing list pgsql-hackers

From Tom Lane
Subject Re: locks in CREATE TRIGGER, ADD FK
Date
Msg-id 1537.1111551578@sss.pgh.pa.us
Whole thread Raw
In response to Re: locks in CREATE TRIGGER, ADD FK  (Neil Conway <neilc@samurai.com>)
Responses Re: locks in CREATE TRIGGER, ADD FK
List pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> Well, we will be holding an ExclusiveLock on the heap relation 
> regardless. We "replace" the heap table by swapping its relfilenode, so 
> ISTM we needn't hold an AccessExclusiveLock.

Utterly wrong.  When you commit you will physically drop the old table.
If there is a SELECT running against the old table it will be quite
unhappy after that.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: locks in CREATE TRIGGER, ADD FK
Next
From: Neil Conway
Date:
Subject: Re: locks in CREATE TRIGGER, ADD FK