Re: SELECT...FOR UPDATE

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Andreas Plesner Jacobsen <apj(at)mutt(dot)dk>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: SELECT...FOR UPDATE
Date: 2002-07-11 21:38:16
Message-ID: 20020711143646.Y66876-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Thu, 11 Jul 2002, Andreas Plesner Jacobsen wrote:

> On Thu, Jul 11, 2002 at 01:16:53PM -0700, Stephan Szabo wrote:
> > >
> > > SELECT table1.Id, table1.User, table1.Data1, table2.data1
> > > FROM table1, table2
> > > FOR UPDATE OF table1
> > > LIMIT 1000
> >
> > I don't think I understand the specification here. It sounds to me
> > you want to get the rows where User is null, but the above query
> > doesn't reflect that, so I must be misunderstanding.
>
> You're quite right, I missed the where clause there:
>
> WHERE table1.user is null and table1.fk_table2=table2.id
>
> > I'd suggest running with query printing turned on to see in more
> > detail what's going on.
>
> I know the exact query, so I don't see, where that would help?

It was more to see what other transactions were doing other than
the one running the above immediately before the deadlock.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Plesner Jacobsen 2002-07-11 21:42:39 Re: SELECT...FOR UPDATE
Previous Message Laurette Cisneros 2002-07-11 21:22:30 collating advice