Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2SGRqU46702 for ; Wed, 28 Mar 2001 11:27:56 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f2SGRmw18400; Wed, 28 Mar 2001 11:27:48 -0500 (EST) To: Mario Jorge Nunes Filipe cc: pgsql-admin@postgresql.org Subject: Re: A crashing query In-reply-to: <985779672.15767.4.camel@neptuno> References: <985779672.15767.4.camel@neptuno> Comments: In-reply-to Mario Jorge Nunes Filipe message dated "28 Mar 2001 12:41:12 +0100" Date: Wed, 28 Mar 2001 11:27:48 -0500 Message-ID: <18397.985796868@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200103/209 X-Sequence-Number: 1056 Mario Jorge Nunes Filipe writes: > Yestrday a new class was added (this is the only difference from before, > and since then the following query no longer works: > select distinct disciplina from lecciona* l where l.docente='$id' and > l.ano_lectivo<= $ano_lectivo and l.classe in ('lecciona','responsável') > and not exists (select 1 from lecciona* l1 where > l1.disciplina=l.disciplina and l1.docente <> l.docente and > l1.ano_lectivo <= $ano_lectivo and l1.ano_lectivo > l.ano_lectivo and > l.classe = l1.classe ) order by disciplina"; Subselects in inherited queries are a tricky area (in fact I just yesterday fixed a bug in 7.1RC1 in that specific area). > this system is a 6.4.2, Try updating to something less ancient --- there are tons of bugs in 6.4.*'s subselect implementation. I'm amazed not that this crashes, but that it ever worked at all. You really should be on 7.0.3, if not experimenting with 7.1. regards, tom lane