Re: [BUGS] Status of issue 4593

From: Marc Munro <marc(at)bloodnok(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [BUGS] Status of issue 4593
Date: 2009-01-12 18:53:29
Message-ID: 1231786409.20267.13.camel@bloodnok.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2009-01-12 at 14:35 -0400, Jeff Davis wrote:
> ate: Mon, 12 Jan 2009 09:52:00 -0800

> On Mon, 2009-01-12 at 08:32 -0500, Tom Lane wrote:
> > That code has been working like this for eight or ten years now and
> this
> > is the first complaint, so taking away functionality on the grounds
> that
> > someone might happen to update the ordering column doesn't seem like
> the
> > answer to me.
> >
>
> If they are using FOR UPDATE, they clearly expect concurrent updates.
> If they're using ORDER BY, they clearly expect the results to be in
> order.
>
> So who is the target user of this functionality we're trying to
> protect?

If by the question above you are asking for a rational use-case, I think
I can give you one.

In my Oracle days I used to use select for update order by, in order to
reduce the likelihood of deadlocks. If locks are always taken in the
same order, deadlocks become considerably less likely.

Unfortunately, I took this construct, which as far as I know works fine
in Oracle, and continued to use it in Postgres just assuming that it
would work.

At least now the source of some of my more mysterious deadlocks is
apparent :-)

I'd second the request for at least a warning to be issued.
__
Marc

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2009-01-12 19:01:49 Re: [BUGS] Status of issue 4593
Previous Message Tom Lane 2009-01-12 18:51:15 Re: [BUGS] Status of issue 4593