Re: LOCK for non-tables

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: LOCK for non-tables
Дата
Msg-id 10015.1295034488@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: LOCK for non-tables  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: LOCK for non-tables  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Jan 14, 2011 at 1:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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.

> 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?

It doesn't seem amazingly unintuitive to me; the syntax diagram just
changes from
LOCK ... [ IN lockmode MODE ] [ NOWAIT ]

to
LOCK ... [ IN lockmode MODE [ NOWAIT ] ]

If it had been that way to start with, nobody would have questioned it.

In any case I'd rather break apps using "LOCK foo NOWAIT" than break
every application using any form of LOCK at all, which is what I think
your proposal will amount to in practice.  People aren't that eager to
write useless noise words, which is what TABLE has been up to now in
this command.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [PATCH] Return command tag 'REPLACE X' for CREATE OR REPLACE statements.
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Database file copy