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

From Russell Smith
Subject Re: locks in CREATE TRIGGER, ADD FK
Date
Msg-id 200503231337.59881.mr-russ@pws.com.au
Whole thread Raw
In response to Re: locks in CREATE TRIGGER, ADD FK  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Responses Re: locks in CREATE TRIGGER, ADD FK  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
On Wed, 23 Mar 2005 12:40 pm, Christopher Kings-Lynne wrote:
> If you want to be my friend forever, then fix CLUSTER so that it uses 
> sharerowexclusive as well :D
> 
I don't think it's as easy as that, because you have to move tuples
around in the cluster operation.  Same sort of issue as vacuum full I would suggest.

Russell Smith

> Chris
> 
> Neil Conway wrote:
> > Neil Conway wrote:
> > 
> >> AndrewSN pointed out on IRC that ALTER TABLE ... ADD FOREIGN KEY and 
> >> CREATE TRIGGER both acquire AccessExclusiveLocks on the table they are 
> >> adding triggers to (the PK table, in the case of ALTER TABLE). Is this 
> >> necessary? I don't see why we can't allow SELECT queries on the table 
> >> to proceed while the trigger is being added.
> > 
> > 
> > Attached is a patch that changes both to use ShareRowExclusiveLock, and 
> > updates the documentation accordingly. I'll apply this later today, 
> > barring any objections.
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 
> 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Using new copy libpq functions on a v2 protocol backend
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: locks in CREATE TRIGGER, ADD FK