pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: havingQual vs hasHavingQual buglets
Date: Tue, 18 Oct 2022 10:46:46 -0400
Message-ID: <2647067.1666104406@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPmGK14uQdQbsv1LSQ5GdxyqNddhceseEjd7-zojXOBQdSmkWQ@mail.gmail.com>
References: <2503888.1666042643@sss.pgh.pa.us>
	<CAMbWs483p-h5caneOz+dfqOpH3W17MZQgCsrc6WcXyt-4vmvuA@mail.gmail.com>
	<CAPmGK14uQdQbsv1LSQ5GdxyqNddhceseEjd7-zojXOBQdSmkWQ@mail.gmail.com>

Etsuro Fujita <etsuro.fujita@gmail.com> writes:
> On Tue, Oct 18, 2022 at 9:47 AM Richard Guo <guofenglinux@gmail.com> wrote:
>> On Tue, Oct 18, 2022 at 5:37 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> I came across a couple of places in the planner that are checking
>>> for nonempty havingQual; but since these bits run after
>>> const-simplification of the HAVING clause, that produces the wrong
>>> answer for a constant-true HAVING clause (which'll be folded to
>>> empty).  Correct code is to check root->hasHavingQual instead.

> The postgres_fdw bits would be my oversight.  :-(

No worries --- I think the one in set_subquery_pathlist is probably
my fault :-(

> +1  HEAD only seems reasonable.

Pushed that way; thanks for looking.

			regards, tom lane





view thread (4+ messages)

Message-ID: <2647067.1666104406@sss.pgh.pa.us>
Permalink:  ../2647067.1666104406@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2647067.1666104406@sss.pgh.pa.us

 · 

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, etsuro.fujita@gmail.com, guofenglinux@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: havingQual vs hasHavingQual buglets
  In-Reply-To: <2647067.1666104406@sss.pgh.pa.us>

* 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