Re: LOCK for non-tables - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: LOCK for non-tables
Date
Msg-id 1B131979-EB62-472F-B1F7-C3F6C41D76D1@hi-media.com
Whole thread Raw
In response to Re: LOCK for non-tables  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Le 14 janv. 2011 à 20:08, Robert Haas <robertmhaas@gmail.com> a écrit :

> On Fri, Jan 14, 2011 at 1:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> So it looks to me like there are at least two fixes other than the ones
>> you enumerated:
>>
>> 1. Make NOWAIT a reserved word.  Not good, but perhaps better than
>> reserving all the different object type names.
>>
>> 2. Disallow the above abbreviated syntax; allow NOWAIT only after an
>> explicit IN ... MODE phrase.  This would probably break a couple of
>> applications, but I bet a lot fewer than changing the longer-established
>> parts of the command syntax would break.
>>
>> I think #2 might be the best choice here.

+1

>
> That strikes me as pretty unintuitive.  I'd rather take the hit of
> forcing people to write "LOCK TABLE foo" instead of just "LOCK foo"
> than try to explain why they have to include "IN ACCESS EXCLUSIVE
> MODE" if they want to stick "NOWAIT" on the end.  However, I guess
> it's a matter of opinion so... anyone else have an opinion?

Since you ask, see above. :)

--
dim

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: limiting hint bit I/O
Next
From: Simon Riggs
Date:
Subject: Re: LOCK for non-tables