pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl
@ 2026-11-11 12:27  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2026-11-11 12:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix MERGE into partitioned table with subquery in UPDATE targetlist.

Under some circumstances, a MERGE into a partitioned table with an
UPDATE action with a subquery in its targetlist would fail with a
"SubPlan found with no parent plan" error.

This was due to ExecInitPartitionInfo() passing a NULL parent
PlanState to ExecBuildUpdateProjection() for the MERGE UPDATE action's
targetlist. Fix by passing &mtstate->ps, like ExecInitMerge().

Backpatch to v15, where MERGE was introduced.

Bug: #19802
Reported-by: Gowtham Reddy <gowthamdoma18@gmail.com>
Author: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Discussion: https://postgr.es/m/19802-ef50a8f1a4b5deee%40postgresql.org
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7a5559a620a54af0cb3e6c22f8ddf7be778c1238

Modified Files
--------------
src/backend/executor/execPartition.c |  2 +-
src/test/regress/expected/merge.out  | 15 +++++++++++++++
src/test/regress/sql/merge.sql       | 11 +++++++++++
3 files changed, 27 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl
@ 2026-11-11 12:27  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2026-11-11 12:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix MERGE into partitioned table with subquery in UPDATE targetlist.

Under some circumstances, a MERGE into a partitioned table with an
UPDATE action with a subquery in its targetlist would fail with a
"SubPlan found with no parent plan" error.

This was due to ExecInitPartitionInfo() passing a NULL parent
PlanState to ExecBuildUpdateProjection() for the MERGE UPDATE action's
targetlist. Fix by passing &mtstate->ps, like ExecInitMerge().

Backpatch to v15, where MERGE was introduced.

Bug: #19802
Reported-by: Gowtham Reddy <gowthamdoma18@gmail.com>
Author: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Discussion: https://postgr.es/m/19802-ef50a8f1a4b5deee%40postgresql.org
Backpatch-through: 15

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/84b86f7a510bceecc2de86b5f4de775d5e0a4fbc

Modified Files
--------------
src/backend/executor/execPartition.c |  2 +-
src/test/regress/expected/merge.out  | 15 +++++++++++++++
src/test/regress/sql/merge.sql       | 11 +++++++++++
3 files changed, 27 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl
@ 2026-11-11 12:27  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2026-11-11 12:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix MERGE into partitioned table with subquery in UPDATE targetlist.

Under some circumstances, a MERGE into a partitioned table with an
UPDATE action with a subquery in its targetlist would fail with a
"SubPlan found with no parent plan" error.

This was due to ExecInitPartitionInfo() passing a NULL parent
PlanState to ExecBuildUpdateProjection() for the MERGE UPDATE action's
targetlist. Fix by passing &mtstate->ps, like ExecInitMerge().

Backpatch to v15, where MERGE was introduced.

Bug: #19802
Reported-by: Gowtham Reddy <gowthamdoma18@gmail.com>
Author: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Discussion: https://postgr.es/m/19802-ef50a8f1a4b5deee%40postgresql.org
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/21234170dc6c8dab99580f34e29d61764df71d3d

Modified Files
--------------
src/backend/executor/execPartition.c |  2 +-
src/test/regress/expected/merge.out  | 15 +++++++++++++++
src/test/regress/sql/merge.sql       | 11 +++++++++++
3 files changed, 27 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl
@ 2026-11-11 12:27  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2026-11-11 12:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix MERGE into partitioned table with subquery in UPDATE targetlist.

Under some circumstances, a MERGE into a partitioned table with an
UPDATE action with a subquery in its targetlist would fail with a
"SubPlan found with no parent plan" error.

This was due to ExecInitPartitionInfo() passing a NULL parent
PlanState to ExecBuildUpdateProjection() for the MERGE UPDATE action's
targetlist. Fix by passing &mtstate->ps, like ExecInitMerge().

Backpatch to v15, where MERGE was introduced.

Bug: #19802
Reported-by: Gowtham Reddy <gowthamdoma18@gmail.com>
Author: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Discussion: https://postgr.es/m/19802-ef50a8f1a4b5deee%40postgresql.org
Backpatch-through: 15

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/220b5263dbb71bbe2966c6d47c0c456c14ed4e48

Modified Files
--------------
src/backend/executor/execPartition.c |  2 +-
src/test/regress/expected/merge.out  | 15 +++++++++++++++
src/test/regress/sql/merge.sql       | 11 +++++++++++
3 files changed, 27 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl
@ 2026-11-11 12:27  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2026-11-11 12:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix MERGE into partitioned table with subquery in UPDATE targetlist.

Under some circumstances, a MERGE into a partitioned table with an
UPDATE action with a subquery in its targetlist would fail with a
"SubPlan found with no parent plan" error.

This was due to ExecInitPartitionInfo() passing a NULL parent
PlanState to ExecBuildUpdateProjection() for the MERGE UPDATE action's
targetlist. Fix by passing &mtstate->ps, like ExecInitMerge().

Backpatch to v15, where MERGE was introduced.

Bug: #19802
Reported-by: Gowtham Reddy <gowthamdoma18@gmail.com>
Author: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Discussion: https://postgr.es/m/19802-ef50a8f1a4b5deee%40postgresql.org
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c374dec8f051be69ca43cf16e51de32b391d1890

Modified Files
--------------
src/backend/executor/execPartition.c |  2 +-
src/test/regress/expected/merge.out  | 15 +++++++++++++++
src/test/regress/sql/merge.sql       | 11 +++++++++++
3 files changed, 27 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl
@ 2026-11-11 12:27  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dean Rasheed @ 2026-11-11 12:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix MERGE into partitioned table with subquery in UPDATE targetlist.

Under some circumstances, a MERGE into a partitioned table with an
UPDATE action with a subquery in its targetlist would fail with a
"SubPlan found with no parent plan" error.

This was due to ExecInitPartitionInfo() passing a NULL parent
PlanState to ExecBuildUpdateProjection() for the MERGE UPDATE action's
targetlist. Fix by passing &mtstate->ps, like ExecInitMerge().

Backpatch to v15, where MERGE was introduced.

Bug: #19802
Reported-by: Gowtham Reddy <gowthamdoma18@gmail.com>
Author: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
Discussion: https://postgr.es/m/19802-ef50a8f1a4b5deee%40postgresql.org
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/291a641ab77ea41fe83c141d1cbb865f2b32d5de

Modified Files
--------------
src/backend/executor/execPartition.c |  2 +-
src/test/regress/expected/merge.out  | 15 +++++++++++++++
src/test/regress/sql/merge.sql       | 11 +++++++++++
3 files changed, 27 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-11-11 12:27 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 12:27 pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl Dean Rasheed <dean.a.rasheed@gmail.com>
2026-11-11 12:27 pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl Dean Rasheed <dean.a.rasheed@gmail.com>
2026-11-11 12:27 pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl Dean Rasheed <dean.a.rasheed@gmail.com>
2026-11-11 12:27 pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl Dean Rasheed <dean.a.rasheed@gmail.com>
2026-11-11 12:27 pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl Dean Rasheed <dean.a.rasheed@gmail.com>
2026-11-11 12:27 pgsql: Fix MERGE into partitioned table with subquery in UPDATE targetl Dean Rasheed <dean.a.rasheed@gmail.com>

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