Re: Dead Lock problem with 8.1.3 - Mailing list pgsql-general

From Kai Hessing
Subject Re: Dead Lock problem with 8.1.3
Date
Msg-id 4nsq2kFbtb5lU1@individual.net
Whole thread Raw
In response to Dead Lock problem with 8.1.3  (Kai Hessing <kai.hessing@hobsons.de>)
Responses Re: Dead Lock problem with 8.1.3  (Martijn van Oosterhout <kleptog@svana.org>)
Re: Dead Lock problem with 8.1.3  (Alban Hertroys <alban@magproductions.nl>)
Re: Dead Lock problem with 8.1.3  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
No one any idea? *sigh*

Kai Hessing wrote:
> Hi Folks,
>
> I have a strange Problem (to be honest there are more than one, but this
> is one of it) after Upgrading to Postgres 8.1.3. The following SQL seems
> to produce a deadlock while doing an endless reading of a temp table:
>
> SELECT s.sid FROM stud s, stud_vera v WHERE s.sid = v.sid AND v.veraid =
> 34 AND s.sid NOT IN ( SELECT sid FROM stud_vera WHERE veraid = 2 );
>
> It should give me a List of sids which are connected to veraid 34 but
> not to veraid 2 at the same time. When removing the 'AND v.veraid = 34':
>
> SELECT s.sid FROM stud s, stud_vera v WHERE s.sid = v.sid AND s.sid NOT
> IN ( SELECT sid FROM stud_vera WHERE veraid = 2 );
>
> everything works really fine (even if I include an additional criteria
> like 'AND stud_vera.status > 0' ). On Postgres 8.0.8 this problem
> doesn't exist. The first clause works with a lot of additional criteria
> very fast.
>
> Any Idea?
>
> *greets*
> Kai

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: change the order of FROM selection to make query work
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Dead Lock problem with 8.1.3