Re: BUG #2503: Query results differ based on record count of unrelated table.

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: BUG #2503: Query results differ based on record count of unrelated table.
Дата
Msg-id 20060629135616.GD1388@surnet.cl
обсуждение исходный текст
Ответ на BUG #2503: Query results differ based on record count of unrelated table.  ("Russell Francis" <rfrancis@ev.net>)
Ответы Re: BUG #2503: Query results differ based on record count  (Russell Francis <rfrancis@ev.net>)
Список pgsql-bugs
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.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Russell Francis"
Дата:
Сообщение: BUG #2503: Query results differ based on record count of unrelated table.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2502: PQclear: "invalid next size"