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

From Neil Conway
Subject Re: locks in CREATE TRIGGER, ADD FK
Date
Msg-id 4240EFFD.4090805@samurai.com
Whole thread Raw
In response to Re: locks in CREATE TRIGGER, ADD FK  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: locks in CREATE TRIGGER, ADD FK  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: locks in CREATE TRIGGER, ADD FK  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> 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.

How can we drop the file at commit, given that a serializable 
transaction's snapshot should still be able to see old relfilenode's 
content?

(If the serializable transaction has already acquired a read lock before 
the TRUNCATE begins, it will block the TRUNCATE -- but there is no 
guarantee that the operations will be ordered like that.)

-Neil


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: locks in CREATE TRIGGER, ADD FK
Next
From: Andrew - Supernews
Date:
Subject: swapping relfilenodes (was: Re: locks in CREATE TRIGGER, ADD FK)