Re: intersect bug - Mailing list pgsql-bugs

From Tom Lane
Subject Re: intersect bug
Date
Msg-id 4087.1003850032@sss.pgh.pa.us
Whole thread Raw
In response to intersect bug  (Wiktor Rzeczkowski <rzeczkow@mcmail.cis.mcmaster.ca>)
List pgsql-bugs
Wiktor Rzeczkowski <rzeczkow@mcmail.cis.mcmaster.ca> writes:
> (select k.bib from kw k where k.kword='concept')
> intersect
> (select k.bib from kw k where k.kword='of')
> intersect
> (select k.bib from kw k where k.kword='god');
>  bib
> ---
> (0 rows)

> // THIS GIVES AN INCORRECT RESULT - see the following //

Yup.  Nested intersect/except structures are buggy in 7.1.*.  I believe
it's fixed for 7.2 however.  If you are in a hurry for a fix, you could
try back-patching the most recent change depicted at
http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepunion.c

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug #490: Can't compile PostgreSQL 7.1.3 with Solaris 2.6
Next
From: Bruce Momjian
Date:
Subject: Re: ALL in SELECT syntax \h psql flawed?