pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix bogus ctid requirement for dummy-root partitioned targets
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix bogus ctid requirement for dummy-root partitioned targets
@ 2026-01-23 01:24  Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Langote @ 2026-01-23 01:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus ctid requirement for dummy-root partitioned targets

ExecInitModifyTable() unconditionally required a ctid junk column even
when the target was a partitioned table. This led to spurious "could
not find junk ctid column" errors when all children were excluded and
only the dummy root result relation remained.

A partitioned table only appears in the result relations list when all
leaf partitions have been pruned, leaving the dummy root as the sole
entry. Assert this invariant (nrels == 1) and skip the ctid requirement.
Also adjust ExecModifyTable() to tolerate invalid ri_RowIdAttNo for
partitioned tables, which is safe since no rows will be processed in
this case.

Bug: #19099
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19099-e05dcfa022fe553d%40postgresql.org
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6d2fa44d2a612ab73f537ecf5428e527c9223da9

Modified Files
--------------
contrib/file_fdw/input/file_fdw.source  | 14 ++++++++++++++
contrib/file_fdw/output/file_fdw.source | 11 +++++++++++
src/backend/executor/nodeModifyTable.c  | 19 ++++++++++++++++---
3 files changed, 41 insertions(+), 3 deletions(-)



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

* pgsql: Fix bogus ctid requirement for dummy-root partitioned targets
@ 2026-01-23 01:24  Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Langote @ 2026-01-23 01:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus ctid requirement for dummy-root partitioned targets

ExecInitModifyTable() unconditionally required a ctid junk column even
when the target was a partitioned table. This led to spurious "could
not find junk ctid column" errors when all children were excluded and
only the dummy root result relation remained.

A partitioned table only appears in the result relations list when all
leaf partitions have been pruned, leaving the dummy root as the sole
entry. Assert this invariant (nrels == 1) and skip the ctid requirement.
Also adjust ExecModifyTable() to tolerate invalid ri_RowIdAttNo for
partitioned tables, which is safe since no rows will be processed in
this case.

Bug: #19099
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19099-e05dcfa022fe553d%40postgresql.org
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/687533b39ecf437388821eed5e93a277c0170853

Modified Files
--------------
contrib/file_fdw/expected/file_fdw.out | 15 +++++++++++++++
contrib/file_fdw/sql/file_fdw.sql      | 18 ++++++++++++++++++
src/backend/executor/nodeModifyTable.c | 19 ++++++++++++++++---
3 files changed, 49 insertions(+), 3 deletions(-)



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

* pgsql: Fix bogus ctid requirement for dummy-root partitioned targets
@ 2026-01-23 01:24  Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Langote @ 2026-01-23 01:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus ctid requirement for dummy-root partitioned targets

ExecInitModifyTable() unconditionally required a ctid junk column even
when the target was a partitioned table. This led to spurious "could
not find junk ctid column" errors when all children were excluded and
only the dummy root result relation remained.

A partitioned table only appears in the result relations list when all
leaf partitions have been pruned, leaving the dummy root as the sole
entry. Assert this invariant (nrels == 1) and skip the ctid requirement.
Also adjust ExecModifyTable() to tolerate invalid ri_RowIdAttNo for
partitioned tables, which is safe since no rows will be processed in
this case.

Bug: #19099
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19099-e05dcfa022fe553d%40postgresql.org
Backpatch-through: 14

Branch
------
REL_16_STABLE

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

Modified Files
--------------
contrib/file_fdw/expected/file_fdw.out | 15 +++++++++++++++
contrib/file_fdw/sql/file_fdw.sql      | 18 ++++++++++++++++++
src/backend/executor/nodeModifyTable.c | 19 ++++++++++++++++---
3 files changed, 49 insertions(+), 3 deletions(-)



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

* pgsql: Fix bogus ctid requirement for dummy-root partitioned targets
@ 2026-01-23 01:24  Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Langote @ 2026-01-23 01:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus ctid requirement for dummy-root partitioned targets

ExecInitModifyTable() unconditionally required a ctid junk column even
when the target was a partitioned table. This led to spurious "could
not find junk ctid column" errors when all children were excluded and
only the dummy root result relation remained.

A partitioned table only appears in the result relations list when all
leaf partitions have been pruned, leaving the dummy root as the sole
entry. Assert this invariant (nrels == 1) and skip the ctid requirement.
Also adjust ExecModifyTable() to tolerate invalid ri_RowIdAttNo for
partitioned tables, which is safe since no rows will be processed in
this case.

Bug: #19099
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19099-e05dcfa022fe553d%40postgresql.org
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/933f67fb6a79d26c5fd69ca6adbadae9efd215fc

Modified Files
--------------
contrib/file_fdw/expected/file_fdw.out | 15 +++++++++++++++
contrib/file_fdw/sql/file_fdw.sql      | 18 ++++++++++++++++++
src/backend/executor/nodeModifyTable.c | 19 ++++++++++++++++---
3 files changed, 49 insertions(+), 3 deletions(-)



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

* pgsql: Fix bogus ctid requirement for dummy-root partitioned targets
@ 2026-01-23 01:24  Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Langote @ 2026-01-23 01:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus ctid requirement for dummy-root partitioned targets

ExecInitModifyTable() unconditionally required a ctid junk column even
when the target was a partitioned table. This led to spurious "could
not find junk ctid column" errors when all children were excluded and
only the dummy root result relation remained.

A partitioned table only appears in the result relations list when all
leaf partitions have been pruned, leaving the dummy root as the sole
entry. Assert this invariant (nrels == 1) and skip the ctid requirement.
Also adjust ExecModifyTable() to tolerate invalid ri_RowIdAttNo for
partitioned tables, which is safe since no rows will be processed in
this case.

Bug: #19099
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19099-e05dcfa022fe553d%40postgresql.org
Backpatch-through: 14

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9f4b7bfc5eb6b3068f35ef5b879d3d8725f5f167

Modified Files
--------------
contrib/file_fdw/expected/file_fdw.out | 15 +++++++++++++++
contrib/file_fdw/sql/file_fdw.sql      | 18 ++++++++++++++++++
src/backend/executor/nodeModifyTable.c | 19 ++++++++++++++++---
3 files changed, 49 insertions(+), 3 deletions(-)



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

* pgsql: Fix bogus ctid requirement for dummy-root partitioned targets
@ 2026-01-23 01:24  Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Amit Langote @ 2026-01-23 01:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bogus ctid requirement for dummy-root partitioned targets

ExecInitModifyTable() unconditionally required a ctid junk column even
when the target was a partitioned table. This led to spurious "could
not find junk ctid column" errors when all children were excluded and
only the dummy root result relation remained.

A partitioned table only appears in the result relations list when all
leaf partitions have been pruned, leaving the dummy root as the sole
entry. Assert this invariant (nrels == 1) and skip the ctid requirement.
Also adjust ExecModifyTable() to tolerate invalid ri_RowIdAttNo for
partitioned tables, which is safe since no rows will be processed in
this case.

Bug: #19099
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19099-e05dcfa022fe553d%40postgresql.org
Backpatch-through: 14

Branch
------
master

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

Modified Files
--------------
contrib/file_fdw/expected/file_fdw.out | 15 +++++++++++++++
contrib/file_fdw/sql/file_fdw.sql      | 18 ++++++++++++++++++
src/backend/executor/nodeModifyTable.c | 19 ++++++++++++++++---
3 files changed, 49 insertions(+), 3 deletions(-)



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


end of thread, other threads:[~2026-01-23 01:24 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-01-23 01:24 pgsql: Fix bogus ctid requirement for dummy-root partitioned targets Amit Langote <amitlan@postgresql.org>
2026-01-23 01:24 pgsql: Fix bogus ctid requirement for dummy-root partitioned targets Amit Langote <amitlan@postgresql.org>
2026-01-23 01:24 pgsql: Fix bogus ctid requirement for dummy-root partitioned targets Amit Langote <amitlan@postgresql.org>
2026-01-23 01:24 pgsql: Fix bogus ctid requirement for dummy-root partitioned targets Amit Langote <amitlan@postgresql.org>
2026-01-23 01:24 pgsql: Fix bogus ctid requirement for dummy-root partitioned targets Amit Langote <amitlan@postgresql.org>
2026-01-23 01:24 pgsql: Fix bogus ctid requirement for dummy-root partitioned targets Amit Langote <amitlan@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