Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW
От
Jeevan Chalke
Тема
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW
Дата
Msg-id
CAM2+6=W5Kcx+YYhXiVTQr+X6zzW12i705A1dSzeu8gRzKG=Yug@mail.gmail.com
Ответ на
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW (Ashutosh Bapat)
Список
Дерево обсуждения
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW Tom Lane <tgl@sss.pgh.pa.us>
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW Tom Lane <tgl@sss.pgh.pa.us>
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW Tom Lane <tgl@sss.pgh.pa.us>
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Re: [BUGS] BUG #14890: Error grouping by same column twice using FDW Jeevan Chalke <jeevan.chalke@enterprisedb.com>
On Fri, Nov 10, 2017 at 6:14 PM, Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> wrote:
+ /*
+ * Pushable, add to tlist. We need to create a tle for this
+ * expression and need to transfer the sortgroupref too. We cannot
+ * use add_to_flat_tlist() here as it avoids the duplicate entries
+ * in the targetlist but here we want those duplicate entries as
+ * there can be multiple GROUP BY expressions pointing to the same
+ * column at different positions.
+ */
+ tle = makeTargetEntry((Expr *) expr, list_length(tlist) + 1, NULL,
+ false);
+ tle->ressortgroupref = sgref;
+ tlist = lappend(tlist, tle);
May be we want to use add_flat_to_tlist() when sgref is not present to avoid
duplicate entries.
These code changes are already inside sgref check. And for other places we do use add_to_flat_tlist().
--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company
--
Jeevan Chalke
Technical Architect, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Technical Architect, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
В списке pgsql-bugs по дате отправления
От: Michael Paquier
Дата:
От: Jeevan Chalke
Дата: