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

Re: locks in CREATE TRIGGER, ADD FK

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>,pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: locks in CREATE TRIGGER, ADD FK
Date: 2005-03-23 04:19:38
Message-ID: 1537.1111551578@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Neil Conway <neilc(at)samurai(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Neil ConwayDate: 2005-03-23 04:26:37
Subject: Re: locks in CREATE TRIGGER, ADD FK
Previous:From: Neil ConwayDate: 2005-03-23 04:09:11
Subject: Re: locks in CREATE TRIGGER, ADD FK

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