pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vik Fearing <vik@postgresfriends.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: Wrong result with constant quals
Date: Fri, 4 Nov 2022 09:07:54 +0100
Message-ID: <7c352569-be76-e796-dc7f-de28cfa0fe3e@postgresfriends.org> (raw)
In-Reply-To: <2198598.1667520868@sss.pgh.pa.us>
References: <f895925a-f2da-5651-af71-21cd8238b9f5@postgresfriends.org>
	<2193245.1667518580@sss.pgh.pa.us>
	<309137b4-9b48-5952-c6e1-0fa7007d0419@postgresfriends.org>
	<2198598.1667520868@sss.pgh.pa.us>

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






view thread (6+ messages)

Message-ID: <7c352569-be76-e796-dc7f-de28cfa0fe3e@postgresfriends.org>
Permalink:  ../7c352569-be76-e796-dc7f-de28cfa0fe3e@postgresfriends.org/
Also on:    postgresql.org/message-id/7c352569-be76-e796-dc7f-de28cfa0fe3e@postgresfriends.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: vik@postgresfriends.org, tgl@sss.pgh.pa.us
  Subject: Re: Wrong result with constant quals
  In-Reply-To: <7c352569-be76-e796-dc7f-de28cfa0fe3e@postgresfriends.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox