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