There is update of a table (850k recs being updated out of 29million recs) which runs for 3 hours and then fails with “attempted to update invisible tuple”.
UPDATE tgt_table ald
SET c1 = updt.c1
c2= updt.c2,
c3 = NOW()
FROM stg_table updt
WHERE ald.pk = updt.pk;
There are no concurrent activity on the tgt_table, no other transactions are updating the table. Multiple reruns of the update fails with same error. This is the only update query updating the table i.e. no other queries updating it. Vacuum analyze is updated on the table, please advise on why this error is being thrown and what can be done to resolve it. What could be causing this? This is on postgres 15.3 aws aurora.