Re: Wrong result with constant quals

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: Wrong result with constant quals
Дата
Msg-id 7c352569-be76-e796-dc7f-de28cfa0fe3e@postgresfriends.org
обсуждение исходный текст
Ответ на Re: Wrong result with constant quals  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On 11/4/22 01:14, Tom Lane wrote:
> Vik Fearing <vik@postgresfriends.org> writes:
>> I allowed for this by saying it could be a single group with no rows if
>> you preferred to look at it that way.
> 
> That is exactly what the standard says.
> 
>> This does not explain why the WHERE FALSE is being ignored and producing
>> rows.
> 
> It's not ignored, but it applies to the pre-grouping rows, of which
> there aren't any to remove.  But there's still a group.

Okay, I can see better what is happening with this query:

select 42
from (values (1), (2), (3)) as _
having true;

  ?column?
----------
        42
(1 row)

-- 
Vik Fearing




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Wrong result with constant quals
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #17233: Incorrect behavior of DELETE command with bad subquery in WHERE clause