Re: [BUGS] Improper const-evaluation of HAVING with grouping sets and subquery pullup

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Michael Paquier <michael.paquier@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>, Pg Bugs <pgsql-bugs@postgresql.org>
Date: 2017-11-29T14:29:29Z
Lists: pgsql-bugs
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Michael" == Michael Paquier <michael.paquier@gmail.com> writes:
>  Michael> Tom, are you planning to finish wrapping up this one? For now
>  Michael> I am moving it to next CF.

> I can take it if Tom and Heikki are busy.

FWIW, I'm not really comfortable that the proposed patch is correct
or complete.  It may just need more study to get there.

			regards, tom lane


Commits

  1. Fix incorrect handling of subquery pullup in the presence of grouping sets.

  2. Make setrefs.c match by ressortgroupref even for plain Vars.

  3. Make the upper part of the planner work by generating and comparing Paths.