Bug #470: INTERSECT fails

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #470: INTERSECT fails
Date: 2001-09-27 14:16:46
Message-ID: 200109271416.f8REGkM33287@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tamas Vincze (vincze(at)neb(dot)com) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
INTERSECT fails

Long Description
I've used INTERSECT to get the common rows in 3 simple SELECTs.
If I write the query without grouping parentheses, PG reports 0 rows
which is incorrect. If I use parentheses to group the last two
SELECTs then it gives a better answer. If I reorder the SELECTs
then it gives another different answer. (see examples)
The result should be independent of the order and grouping of
the SELECTs, so I think it's a serious bug.
I use version 7.1.2 on solaris/sparc.

Sample Code
sites=# select recseq from frags where len>2222 and len<2406
sites-# intersect select recseq from frags where len>1503 and len<1627
sites-# intersect select recseq from frags where len>752 and len<814;
recseq
--------
(0 rows)

sites=# select recseq from frags where len>2222 and len<2406
sites-# intersect (select recseq from frags where len>1503 and len<1627
sites(# intersect select recseq from frags where len>752 and len<814);
recseq
--------
CACTG
CAGTG
CASTG
RGCGCY
YAACCT
(5 rows)

sites=# select recseq from frags where len>1503 and len<1627
sites-# intersect select recseq from frags where len>752 and len<814
sites-# intersect select recseq from frags where len>2222 and len<2406;
recseq
--------
CACTG
CAGTG
RGCGCY
YAACCT
(4 rows)

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-09-27 14:25:58 Re: bug! in 7.1.3 (for recursion function)
Previous Message Vince Vielhaber 2001-09-27 14:14:43 Re: CVS rejected me