Re: Change lock requirements for adding a trigger - Mailing list pgsql-hackers

From Decibel!
Subject Re: Change lock requirements for adding a trigger
Date
Msg-id 85B9C2D2-76F8-467F-958B-A1B8324A74FA@decibel.org
Whole thread Raw
In response to Re: Change lock requirements for adding a trigger  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Change lock requirements for adding a trigger  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Jun 3, 2008, at 5:04 PM, Simon Riggs wrote:
> On Tue, 2008-06-03 at 16:48 -0500, Decibel! wrote:
>> On May 30, 2008, at 9:51 AM, Simon Riggs wrote:
>>> On Thu, 2008-05-29 at 19:18 -0500, Decibel! wrote:
>>>> Is there a reason that we can't add a trigger to a table while a
>>>> select is running? This is a serious pain when trying to setup
>>>> londiste or slony.
>>>
>>> This is constrained by locking.
>>>
>>> There are a subset of DDL commands that might be able to be  
>>> performed
>>> with just an ExclusiveLock or ShareLock rather than an
>>> AccessExclusiveLock. Nobody has studied which sub-statements this
>>> might
>>> apply to, but its do-able since CREATE INDEX already does this.
>>
>> Is there a good way to determine this other than depending on
>> knowledge of the source code?
>
> The source doesn't know yet. So just analysis and thinking.
>
> The mechanism to hold less than an AccessExclusiveLock it doesn't  
> exist
> yet, but it never will unless we have a list of the things that  
> might be
> performed correctly with a lower level of lock.

Ok, I'll take a stab at such a list. Can anyone think of any reasons  
why CREATE TRIGGER couldn't get by with ShareLock?
-- 
Decibel!, aka Jim C. Nasby, Database Architect  decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828



pgsql-hackers by date:

Previous
From: Decibel!
Date:
Subject: Re: rfc: add pg_dump options to dump output
Next
From: Andreas Pflug
Date:
Subject: Re: Overhauling GUCS