Re: A crashing query - Mailing list pgsql-admin

From Tom Lane
Subject Re: A crashing query
Date
Msg-id 18397.985796868@sss.pgh.pa.us
Whole thread Raw
In response to A crashing query  (Mario Jorge Nunes Filipe <mjnf@uevora.pt>)
List pgsql-admin
Mario Jorge Nunes Filipe <mjnf@uevora.pt> 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

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: date_part bug?
Next
From: "Timothy Morris"
Date:
Subject: can't read - permissions error (13)