pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Don't pass grouped relations to FDWs 2+ messages / 1 participants [nested] [flat]
* pgsql: Don't pass grouped relations to FDWs @ 2026-10-05 23:52 Richard Guo <rguo@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Richard Guo @ 2026-10-05 23:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't pass grouped relations to FDWs build_grouped_rel() makes a flat copy of the input relation, including its FDW fields. As a result, when building a grouped join relation for eager aggregation, add_paths_to_joinrel() called the FDW's GetForeignJoinPaths for it. postgres_fdw then failed with "Aggref found where not expected" on the partial Aggrefs in the target list, and in any case it would have treated a partially aggregated input as a plain foreign scan. FDWs are not prepared to handle grouped relations, so clear serverid, fdwroutine and fdw_private in build_grouped_rel(). Reported-by: Robert Haas <robertmhaas@gmail.com> Author: Richard Guo <guofenglinux@gmail.com> Discussion: https://postgr.es/m/CA+Tgmob7iSM9YkRM44VjUDuaCchW-fY54MV5njpTZTL9uNyV4w@mail.gmail.com Backpatch-through: 19 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/58fca6bdf26f55484c11bf505ae699ec240d60cb Modified Files -------------- contrib/postgres_fdw/expected/postgres_fdw.out | 26 ++++++++++++++++++++++++++ contrib/postgres_fdw/sql/postgres_fdw.sql | 5 +++++ src/backend/optimizer/util/relnode.c | 7 +++++++ 3 files changed, 38 insertions(+) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Don't pass grouped relations to FDWs @ 2026-10-05 23:52 Richard Guo <rguo@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Richard Guo @ 2026-10-05 23:52 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't pass grouped relations to FDWs build_grouped_rel() makes a flat copy of the input relation, including its FDW fields. As a result, when building a grouped join relation for eager aggregation, add_paths_to_joinrel() called the FDW's GetForeignJoinPaths for it. postgres_fdw then failed with "Aggref found where not expected" on the partial Aggrefs in the target list, and in any case it would have treated a partially aggregated input as a plain foreign scan. FDWs are not prepared to handle grouped relations, so clear serverid, fdwroutine and fdw_private in build_grouped_rel(). Reported-by: Robert Haas <robertmhaas@gmail.com> Author: Richard Guo <guofenglinux@gmail.com> Discussion: https://postgr.es/m/CA+Tgmob7iSM9YkRM44VjUDuaCchW-fY54MV5njpTZTL9uNyV4w@mail.gmail.com Backpatch-through: 19 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c9231b776b3643d0f25aff337dbf22db961c64fe Modified Files -------------- contrib/postgres_fdw/expected/postgres_fdw.out | 26 ++++++++++++++++++++++++++ contrib/postgres_fdw/sql/postgres_fdw.sql | 5 +++++ src/backend/optimizer/util/relnode.c | 7 +++++++ 3 files changed, 38 insertions(+) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-10-05 23:52 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-10-05 23:52 pgsql: Don't pass grouped relations to FDWs Richard Guo <rguo@postgresql.org> 2026-10-05 23:52 pgsql: Don't pass grouped relations to FDWs Richard Guo <rguo@postgresql.org>
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