pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
@ 2025-09-04 10:40 Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Dean Rasheed @ 2025-09-04 10:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix replica identity check for INSERT ON CONFLICT DO UPDATE.

If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must
check that the target relation supports UPDATE as well as INSERT. In
particular, it must check that the target relation has a REPLICA
IDENTITY if it publishes updates. Formerly, it was not doing this
check, which could lead to silently breaking replication.

Fix by adding such a check to CheckValidResultRel(), which requires
adding a new onConflictAction argument. In back-branches, preserve ABI
compatibility by introducing a wrapper function with the original
signature.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Tested-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/OS3PR01MB57180C87E43A679A730482DF94B62@OS3PR01MB5718.jpnprd01.prod.outlook.com
Backpatch-through: 13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5386bfb9c1f566887d084e4ea2e350e7efd188c1

Modified Files
--------------
src/backend/commands/copyfrom.c           |  2 +-
src/backend/executor/execMain.c           | 12 +++++++++++-
src/backend/executor/execPartition.c      |  9 +++++++--
src/backend/executor/nodeModifyTable.c    |  3 ++-
src/include/executor/executor.h           |  1 +
src/test/regress/expected/publication.out | 23 +++++++++++++++++++++++
src/test/regress/sql/publication.sql      | 27 +++++++++++++++++++++++++++
7 files changed, 72 insertions(+), 5 deletions(-)



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

* pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
@ 2025-09-04 10:40 Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Dean Rasheed @ 2025-09-04 10:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix replica identity check for INSERT ON CONFLICT DO UPDATE.

If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must
check that the target relation supports UPDATE as well as INSERT. In
particular, it must check that the target relation has a REPLICA
IDENTITY if it publishes updates. Formerly, it was not doing this
check, which could lead to silently breaking replication.

Fix by adding such a check to CheckValidResultRel(), which requires
adding a new onConflictAction argument. In back-branches, preserve ABI
compatibility by introducing a wrapper function with the original
signature.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Tested-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/OS3PR01MB57180C87E43A679A730482DF94B62@OS3PR01MB5718.jpnprd01.prod.outlook.com
Backpatch-through: 13

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/344662848ac15efc89e09b7d39662d7c71b30e06

Modified Files
--------------
src/backend/commands/copyfrom.c           |  2 +-
src/backend/executor/execMain.c           | 12 +++++++++++-
src/backend/executor/execPartition.c      |  9 +++++++--
src/backend/executor/nodeModifyTable.c    |  3 ++-
src/include/executor/executor.h           |  1 +
src/test/regress/expected/publication.out | 23 +++++++++++++++++++++++
src/test/regress/sql/publication.sql      | 27 +++++++++++++++++++++++++++
7 files changed, 72 insertions(+), 5 deletions(-)



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

* pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
@ 2025-09-04 10:40 Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Dean Rasheed @ 2025-09-04 10:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix replica identity check for INSERT ON CONFLICT DO UPDATE.

If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must
check that the target relation supports UPDATE as well as INSERT. In
particular, it must check that the target relation has a REPLICA
IDENTITY if it publishes updates. Formerly, it was not doing this
check, which could lead to silently breaking replication.

Fix by adding such a check to CheckValidResultRel(), which requires
adding a new onConflictAction argument. In back-branches, preserve ABI
compatibility by introducing a wrapper function with the original
signature.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Tested-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/OS3PR01MB57180C87E43A679A730482DF94B62@OS3PR01MB5718.jpnprd01.prod.outlook.com
Backpatch-through: 13

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0b934d3994ffdd4b9d557a216a381cca4d6e6f11

Modified Files
--------------
src/backend/executor/execMain.c           | 26 ++++++++++++++++++++++++--
src/backend/executor/execPartition.c      |  9 +++++++--
src/backend/executor/nodeModifyTable.c    |  3 ++-
src/include/executor/executor.h           |  3 +++
src/test/regress/expected/publication.out | 23 +++++++++++++++++++++++
src/test/regress/sql/publication.sql      | 26 ++++++++++++++++++++++++++
6 files changed, 85 insertions(+), 5 deletions(-)



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

* pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
@ 2025-09-04 10:40 Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Dean Rasheed @ 2025-09-04 10:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix replica identity check for INSERT ON CONFLICT DO UPDATE.

If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must
check that the target relation supports UPDATE as well as INSERT. In
particular, it must check that the target relation has a REPLICA
IDENTITY if it publishes updates. Formerly, it was not doing this
check, which could lead to silently breaking replication.

Fix by adding such a check to CheckValidResultRel(), which requires
adding a new onConflictAction argument. In back-branches, preserve ABI
compatibility by introducing a wrapper function with the original
signature.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Tested-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/OS3PR01MB57180C87E43A679A730482DF94B62@OS3PR01MB5718.jpnprd01.prod.outlook.com
Backpatch-through: 13

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0c4d5a45dbd7d11c9ddff4f7cf4dae3940b083be

Modified Files
--------------
src/backend/executor/execMain.c           | 23 ++++++++++++++++++++++-
src/backend/executor/execPartition.c      |  8 ++++++--
src/backend/executor/nodeModifyTable.c    |  3 ++-
src/include/executor/executor.h           |  2 ++
src/test/regress/expected/publication.out | 23 +++++++++++++++++++++++
src/test/regress/sql/publication.sql      | 26 ++++++++++++++++++++++++++
6 files changed, 81 insertions(+), 4 deletions(-)



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

* pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
@ 2025-09-04 10:40 Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Dean Rasheed @ 2025-09-04 10:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix replica identity check for INSERT ON CONFLICT DO UPDATE.

If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must
check that the target relation supports UPDATE as well as INSERT. In
particular, it must check that the target relation has a REPLICA
IDENTITY if it publishes updates. Formerly, it was not doing this
check, which could lead to silently breaking replication.

Fix by adding such a check to CheckValidResultRel(), which requires
adding a new onConflictAction argument. In back-branches, preserve ABI
compatibility by introducing a wrapper function with the original
signature.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Tested-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/OS3PR01MB57180C87E43A679A730482DF94B62@OS3PR01MB5718.jpnprd01.prod.outlook.com
Backpatch-through: 13

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/451b22efd9ac4a1014af8add5405d809d92ff590

Modified Files
--------------
src/backend/executor/execMain.c           | 23 ++++++++++++++++++++++-
src/backend/executor/execPartition.c      |  8 ++++++--
src/backend/executor/nodeModifyTable.c    |  3 ++-
src/include/executor/executor.h           |  2 ++
src/test/regress/expected/publication.out | 23 +++++++++++++++++++++++
src/test/regress/sql/publication.sql      | 26 ++++++++++++++++++++++++++
6 files changed, 81 insertions(+), 4 deletions(-)



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

* pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
@ 2025-09-04 10:40 Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Dean Rasheed @ 2025-09-04 10:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix replica identity check for INSERT ON CONFLICT DO UPDATE.

If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must
check that the target relation supports UPDATE as well as INSERT. In
particular, it must check that the target relation has a REPLICA
IDENTITY if it publishes updates. Formerly, it was not doing this
check, which could lead to silently breaking replication.

Fix by adding such a check to CheckValidResultRel(), which requires
adding a new onConflictAction argument. In back-branches, preserve ABI
compatibility by introducing a wrapper function with the original
signature.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Tested-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/OS3PR01MB57180C87E43A679A730482DF94B62@OS3PR01MB5718.jpnprd01.prod.outlook.com
Backpatch-through: 13

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5fd569ef2d621d3a36d69b6ceb669866014db39d

Modified Files
--------------
src/backend/executor/execMain.c           | 23 ++++++++++++++++++++++-
src/backend/executor/execPartition.c      |  8 ++++++--
src/backend/executor/nodeModifyTable.c    |  3 ++-
src/include/executor/executor.h           |  2 ++
src/test/regress/expected/publication.out | 23 +++++++++++++++++++++++
src/test/regress/sql/publication.sql      | 26 ++++++++++++++++++++++++++
6 files changed, 81 insertions(+), 4 deletions(-)



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

* pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE.
@ 2025-09-04 10:40 Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Dean Rasheed @ 2025-09-04 10:40 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix replica identity check for INSERT ON CONFLICT DO UPDATE.

If an INSERT has an ON CONFLICT DO UPDATE clause, the executor must
check that the target relation supports UPDATE as well as INSERT. In
particular, it must check that the target relation has a REPLICA
IDENTITY if it publishes updates. Formerly, it was not doing this
check, which could lead to silently breaking replication.

Fix by adding such a check to CheckValidResultRel(), which requires
adding a new onConflictAction argument. In back-branches, preserve ABI
compatibility by introducing a wrapper function with the original
signature.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com>
Tested-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/OS3PR01MB57180C87E43A679A730482DF94B62@OS3PR01MB5718.jpnprd01.prod.outlook.com
Backpatch-through: 13

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0610b843c9718dafba54590da38fed0cda52cd6d

Modified Files
--------------
src/backend/executor/execMain.c           | 23 ++++++++++++++++++++++-
src/backend/executor/execPartition.c      |  8 ++++++--
src/backend/executor/nodeModifyTable.c    |  3 ++-
src/include/executor/executor.h           |  2 ++
src/test/regress/expected/publication.out | 23 +++++++++++++++++++++++
src/test/regress/sql/publication.sql      | 26 ++++++++++++++++++++++++++
6 files changed, 81 insertions(+), 4 deletions(-)



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


end of thread, other threads:[~2025-09-04 10:40 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-04 10:40 pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE. Dean Rasheed <dean.a.rasheed@gmail.com>
2025-09-04 10:40 pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE. Dean Rasheed <dean.a.rasheed@gmail.com>
2025-09-04 10:40 pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE. Dean Rasheed <dean.a.rasheed@gmail.com>
2025-09-04 10:40 pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE. Dean Rasheed <dean.a.rasheed@gmail.com>
2025-09-04 10:40 pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE. Dean Rasheed <dean.a.rasheed@gmail.com>
2025-09-04 10:40 pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE. Dean Rasheed <dean.a.rasheed@gmail.com>
2025-09-04 10:40 pgsql: Fix replica identity check for INSERT ON CONFLICT DO UPDATE. 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