Re: Query not working as expected...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Titus J(dot) Anderson" <titus(dot)anderson(at)louisville(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query not working as expected...
Date: 2002-05-17 22:46:35
Message-ID: 22995.1021675595@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Titus J. Anderson" <titus(dot)anderson(at)louisville(dot)edu> writes:
> Notice the last row. The row with did 5738 is NOT in the result set from the
> second query, which is the subquery of the above command. So why is this
> showing up in the results? Anyone have an idea?

What version are you running? This looks a lot like a bug that was
fixed in 7.1.3:

2001-07-31 14:39 tgl

* src/: backend/optimizer/path/allpaths.c,
backend/optimizer/util/clauses.c, backend/utils/adt/ruleutils.c,
include/optimizer/clauses.h (REL7_1_STABLE): Fix optimizer to not
try to push WHERE clauses down into a sub-SELECT that has a
DISTINCT ON clause, per bug report from Anthony Wood. While at it,
improve the DISTINCT-ON-clause recognizer routine to not be fooled
by out-of-order DISTINCT lists. Also, back-patch earlier fix to
not push down into sub-SELECT with LIMIT.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message postgres 2002-05-17 23:05:27 Re: psql command history
Previous Message Laurette Cisneros 2002-05-17 22:30:33 Re: psql command history