postgresql/contrib/postgres_fdw
Tom Lane e9f2703ab7 Fix postgres_fdw to cope with duplicate GROUP BY entries.
Commit 7012b132d, which added the ability to push down aggregates and
grouping to the remote server, wasn't careful to ensure that the remote
server would have the same idea we do about which columns are the grouping
columns, in cases where there are textually identical GROUP BY expressions.
Such cases typically led to "targetlist item has multiple sortgroupref
labels" errors.

To fix this reliably, switch over to using "GROUP BY column-number" syntax
rather than "GROUP BY expression" in transmitted queries, and adjust
foreign_grouping_ok() to be more careful about duplicating the sortgroupref
labeling of the local pathtarget.

Per bug #14890 from Sean Johnston.  Back-patch to v10 where the buggy code
was introduced.

Jeevan Chalke, reviewed by Ashutosh Bapat

Discussion: https://postgr.es/m/20171107134948.1508.94783@wrigleys.postgresql.org
2018-01-12 16:52:49 -05:00
..
expected Fix postgres_fdw to cope with duplicate GROUP BY entries. 2018-01-12 16:52:49 -05:00
sql Fix postgres_fdw to cope with duplicate GROUP BY entries. 2018-01-12 16:52:49 -05:00
.gitignore Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
connection.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
deparse.c Fix postgres_fdw to cope with duplicate GROUP BY entries. 2018-01-12 16:52:49 -05:00
Makefile Allow postgres_fdw to ship extension funcs/operators for remote execution. 2015-11-03 18:42:18 -05:00
option.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
postgres_fdw--1.0.sql Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.c Fix postgres_fdw to cope with duplicate GROUP BY entries. 2018-01-12 16:52:49 -05:00
postgres_fdw.control Add postgres_fdw contrib module. 2013-02-21 05:27:16 -05:00
postgres_fdw.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
shippable.c Update copyright for 2018 2018-01-02 23:30:12 -05:00