pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix postgres_fdw to cope with duplicate GROUP BY entries. 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix postgres_fdw to cope with duplicate GROUP BY entries. @ 2018-01-12 21:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2018-01-12 21:53 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e9f2703ab7b29f7e9100807cfbd19ddebbaa0b12 Modified Files -------------- contrib/postgres_fdw/deparse.c | 17 ++- contrib/postgres_fdw/expected/postgres_fdw.out | 163 ++++++++++++++----------- contrib/postgres_fdw/postgres_fdw.c | 83 ++++++------- contrib/postgres_fdw/sql/postgres_fdw.sql | 6 + 4 files changed, 150 insertions(+), 119 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix postgres_fdw to cope with duplicate GROUP BY entries. @ 2018-01-12 21:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2018-01-12 21:53 UTC (permalink / raw) To: pgsql-committers 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 Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/67854bc59a8b283f02f2a8f0c0095df639bedf06 Modified Files -------------- contrib/postgres_fdw/deparse.c | 17 ++- contrib/postgres_fdw/expected/postgres_fdw.out | 163 ++++++++++++++----------- contrib/postgres_fdw/postgres_fdw.c | 83 ++++++------- contrib/postgres_fdw/sql/postgres_fdw.sql | 6 + 4 files changed, 150 insertions(+), 119 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2018-01-12 21:53 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-01-12 21:53 pgsql: Fix postgres_fdw to cope with duplicate GROUP BY entries. Tom Lane <tgl@sss.pgh.pa.us> 2018-01-12 21:53 pgsql: Fix postgres_fdw to cope with duplicate GROUP BY entries. Tom Lane <tgl@sss.pgh.pa.us>
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