Re: LOCK for non-tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tatsuo Ishii <ishii(at)postgresql(dot)org>, fgp(at)phlo(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: LOCK for non-tables
Date: 2011-01-14 22:34:30
Message-ID: 13017.1295044470@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> On Fri, 2011-01-14 at 16:09 -0500, Tom Lane wrote:
>> I think the realistic options are (1) change the syntax
>> non-backward-compatibly or (2) don't add any functionality here.

> (3) think of another way.

The only third way that I can see is to invent some new, unrelated
syntax for the new facilities. For example (just a straw man)

ACQUIRE LOCK FOR object-type object-name opt-lock-type opt-no-wait

The objection to this approach (which can also be lodged against your
function proposal) is that it's a larger burden on users: now they have
two syntaxes to remember, more complicated code to write if it needs to
use both syntaxes, etc. In the long run this is more trouble than a
one-time adjustment, especially if that adjustment can be limited to a
small number of uncommon cases.

> I'm not keen to explain to people how we broke their applications just
> because we wanted to add new functionality AND avoid one shift/reduce
> conflict in our SQL grammar. Avoiding changes to user code isn't third
> on that list of three things I want, its first.

I grow weary of discussions in which somebody argues that consideration
X always outweighs every other consideration. We're doing engineering
here, not theology, and there are always tradeoffs to be made. In this
case it's my opinion that a small syntax adjustment is the best
tradeoff.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira de Oliveira 2011-01-14 22:42:57 Re: Named restore points
Previous Message Fujii Masao 2011-01-14 22:31:35 Reduce the amount of data loss on the standby