ERROR: tuple to be updated was already modified by an operation triggered by the current command

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: ERROR: tuple to be updated was already modified by an operation triggered by the current command
Date: 2025-01-23 09:11:44
Message-ID: CAMbWs4-XwMKMKJ_GT=p3_-_=j9rQSEs1FbDFUnW9zHuKPsPNEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I came across $SUBJECT, which can be reproduced using the queries
below.

# create temporary table p (a int primary key) on commit delete rows;
CREATE TABLE
# create temporary table c () inherits (p);
CREATE TABLE

# analyze; -- no error
ANALYZE

# drop table c;
DROP TABLE

# analyze; -- error
ERROR: tuple to be updated was already modified by an operation
triggered by the current command

This error happens in heap_inplace_lock(), and git-bisect says the
first bad commit is:

a07e03fd8fa7daf4d1356f7cb501ffe784ea6257 is the first bad commit
commit a07e03fd8fa7daf4d1356f7cb501ffe784ea6257
Author: Noah Misch <noah(at)leadboat(dot)com>
Date: Tue Sep 24 15:25:18 2024 -0700

Fix data loss at inplace update after heap_update().

... which introduced heap_inplace_lock().

Is this error expected, or could it be a bug?

Thanks
Richard

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2025-01-23 14:24:47 Re: BUG #18774: Not the required output of the query used in the function(delete_from_table1) in postgresql9.4
Previous Message Rajni Bobal 2025-01-23 08:57:07 Re: BUG #18774: Not the required output of the query used in the function(delete_from_table1) in postgresql9.4