Re: Server crash on UPDATE after savepoint rollback when the row is locked by the same transaction (Assert HEAP_XMAX_IS_LOCKED_ONLY in heap_update)

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: RekGRpth <rekgrpth(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Server crash on UPDATE after savepoint rollback when the row is locked by the same transaction (Assert HEAP_XMAX_IS_LOCKED_ONLY in heap_update)
Date: 2026-11-02 09:36:47
Message-ID: a4af98b6-256d-48a9-8599-85d661448e63@iki.fi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 02/11/2026 09:14, RekGRpth wrote:
> Steps to reproduce (any assert build):
>
> CREATE TABLE tr (id int primary key, val text);
> INSERT INTO tr VALUES (1, 'x');
> BEGIN;
> SELECT id FROM tr WHERE id = 1 FOR NO KEY UPDATE;
> SAVEPOINT s;
> UPDATE tr SET val = 'sub' WHERE id = 1;
> ROLLBACK TO SAVEPOINT s;
> RELEASE SAVEPOINT s;
> UPDATE tr SET val = repeat('md5', 4000) WHERE id = 1;
> COMMIT;
>
> The last UPDATE crashes the server:
>
> TRAP: failed Assert("HEAP_XMAX_IS_LOCKED_ONLY(infomask_lock_old_tuple)"),
> File: "heapam.c", Line: 3886 (19rc1; 4046 in 10.23)
> ExceptionalCondition + heap_update + ...

This was previously reported at
https://www.postgresql.org/message-id/CAOG%2BRQ6ECiiFH7bb7e1M0bkd0whprp%3DT0u%3DrvARSaPOGrY-NDQ%40mail.gmail.com

- Heikki

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Dilip Kumar 2026-11-02 12:46:11 Re: BUG #19817: CREATE UNIQUE INDEX on a partitioned table can silently attach an invalid, not-ready child index, le
Previous Message apex-security-research 2026-11-02 09:06:24 contrib/cube: NaN coordinates break the btree equivalence relation, so UNIQUE rejects distinct values and ORDER BY is unstable