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

Re: BUG #2503: Query results differ based on record count

From: Russell Francis <rfrancis(at)ev(dot)net>
To: Russell Francis <rfrancis(at)ev(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2503: Query results differ based on record count
Date: 2006-06-29 19:03:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Alvaro Herrera wrote:
> Russell Francis wrote:
>> If a SELECT statement contains a table in it's FROM clause which has 0
>> records in it, the query will not return any results.  If a record is added
>> to the table even though it shouldn't modify the results of query, the query
>> will return the expected result.
>> The SQL statements below are a trimmed down test case which duplicates this
>> issue.  The identical SELECT statements return different results depending
>> on the record count of the unrelated table_b.
>> SELECT table_a.* FROM table_a, table_b WHERE table_a.ta_col_a > 0;
> table_b is certainly not unrelated, as it appears in the FROM clause.
> So the query is correct to not show any result, per definition of
> cartesian product.


Yes, you are correct.  Sorry.


In response to

pgsql-bugs by date

Next:From: Jim C. NasbyDate: 2006-06-29 21:58:11
Subject: Re: [BUGS] BUG #2505: Translations error in pgAdmin III
Previous:From: Wagner CiprianoDate: 2006-06-29 14:09:42
Subject: BUG #2506: hash index

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