pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix assertions with RI triggers in heap_update and heap_delete.
Date: Tue, 28 Nov 2023 10:38:20 +0000
Message-ID: <E1r7vTv-007eBr-Qg@gemulon.postgresql.org> (raw)

Fix assertions with RI triggers in heap_update and heap_delete.

If the tuple being updated is not visible to the crosscheck snapshot,
we return TM_Updated but the assertions would not hold in that case.
Move them to before the cross-check.

Fixes bug #17893. Backpatch to all supported versions.

Author: Alexander Lakhin
Backpatch-through: 12
Discussion: https://www.postgresql.org/message-id/17893-35847009eec517b5%40postgresql.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2873fbfe0d6500a45a316d2d42414a432a96e9f1

Modified Files
--------------
src/backend/access/heap/heapam.c            | 41 +++++++++++++++++------------
src/include/access/tableam.h                |  4 +--
src/test/isolation/expected/fk-snapshot.out | 22 ++++++++++++++++
src/test/isolation/specs/fk-snapshot.spec   | 17 +++++++++++-
4 files changed, 64 insertions(+), 20 deletions(-)



view thread (6+ messages)

Message-ID: <E1r7vTv-007eBr-Qg@gemulon.postgresql.org>
Permalink:  ../E1r7vTv-007eBr-Qg@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1r7vTv-007eBr-Qg@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix assertions with RI triggers in heap_update and heap_delete.
  In-Reply-To: <E1r7vTv-007eBr-Qg@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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