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

From Dimitri Fontaine
Subject Re: LOCK for non-tables
Date
Msg-id m2mxn0a78q.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: LOCK for non-tables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Another possibility is to disallow just the single case
>     LOCK tablename NOWAIT
> ie, you can write NOWAIT if you include *either* the object type
> or the IN...MODE clause.  This is not too hard as far as the grammar
> is concerned, but I'm not exactly sure how to document it.

I don't see anything better than documenting it using 2 extra lines:
 LOCK [ TABLE ] [ ONLY ] name [, ...] [ IN lockmode MODE ] LOCK TABLE tablename [ IN lockmode MODE ] [ NOWAIT ] LOCK [
TABLE] [ ONLY ] tablename IN lockmode MODE [ NOWAIT ] 

Ok it looks like a mess, but that's what it is :)

And every user with "LOCK tablename NOWAIT" in their code would have to
change that to "LOCK TABLE tablename NOWAIT".  Is there no way to reduce
that to only be a problem with tables named the same as the new objects
we want to add support for?

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: pg_stat_replication security
Next
From: Pavel Stehule
Date:
Subject: Re: texteq/byteaeq: avoid detoast [REVIEW]