Skip site navigation (1) Skip section navigation (2)

Re: Bug #536: the sql 'except' generates erroneous result

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: liao(at)sandiego(dot)edu, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #536: the sql 'except' generates erroneous result
Date: 2001-12-12 02:23:30
Message-ID: 21076.1008123810@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
pgsql-bugs(at)postgresql(dot)org writes:
> the sql 'except' generates erroneous result

Yeah, anything with nested intersect/except is likely to give the wrong
answers in 7.1.* :-(.  This seems to be a variant of that problem.
In 7.2beta I get the expected answer:

regression=# select distinct t.studid from stranscript t where not exists(
regression(# (select p.id from s_professor p where p.deptid = 'MUS')
regression(# except
regression(# (select  te.profid from s_teaching te, stranscript t1 where
regression(# t1.crscode=te.crscode and t1.semester = te.sem and t1.studid=t.studid));
 studid 
--------
    100
(1 row)

regression=# 

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: NicolaiDate: 2001-12-12 15:50:39
Subject: Unable to compare _bpchar for similarity in WHERE-clause (MINOR ANNOYANCE)
Previous:From: pgsql-bugsDate: 2001-12-12 01:27:46
Subject: Bug #536: the sql 'except' generates erroneous result

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group