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 4240DE98.40806@samurai.com
Whole thread Raw
In response to Re: locks in CREATE TRIGGER, ADD FK  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: locks in CREATE TRIGGER, ADD FK
List pgsql-hackers
Bruce Momjian wrote:
> Certainly we need to upgrade to an exclusive table lock to replace the
> heap table.

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.

> Do we want to get a shared lock and possibly starve waiting
> for an exclusive lock on the table to swap the new one in?

What I'm saying is that REINDEX on non-shared indexes need only acquire 
an ExclusiveLock, and hence not need to escalate its lock.

-Neil


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: locks in CREATE TRIGGER, ADD FK
Next
From: Tom Lane
Date:
Subject: Re: locks in CREATE TRIGGER, ADD FK