Re: BUG #16585: Wrong filtering on a COALESCE field after using GROUPING SETS
Andrew Gierth <andrew@tao11.riddles.org.uk>
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Rowley <dgrowleyml@gmail.com>, pavelsivash@gmail.com,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2020-08-20T21:51:32Z
Lists: pgsql-bugs
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes: Tom> As a stopgap measure, I think what we have to do is teach Tom> check_output_expressions that subquery output columns are unsafe Tom> to reference if they are not listed in all grouping sets (do I Tom> have that condition right?). Unless I'm missing something, it should be safe to reference output columns that are not mentioned in any grouping set, or which are mentioned in all grouping sets (after all expansions); but unsafe to reference columns mentioned in some grouping sets but not others (since these will be forced to null in the output for the sets in which they don't appear). -- Andrew (irc:RhodiumToad)
Commits
-
Avoid pushing quals down into sub-queries that have grouping sets.
- de627adaad3a 13.0 landed
- d3701bc8a25b 9.6.20 landed
- b439adcabbf9 11.10 landed
- 7edd36eae1fd 9.5.24 landed
- 6fa403e61241 10.15 landed
- 6b701eaaa90e 12.5 landed
- 4d346def1555 14.0 landed