Hans Buschmann <buschmann@nidsa.net> writes:
> 1st query: ERROR
> 2nd query to or_followup_archiv: Succeeds
> then 1st query repeated: SUCCEEDS!!
> With this direct update to or_followup_archiv (or an unclustered table) the error disappears.
Yeah. After more study I think there's less there than meets the
eye. If the row update manages to be HOT then we don't need to make
any new index entries so we never reach the troublesome code.
In your original reproducer, the CLUSTER step was important because
it left the target tuple in a fully-packed page with no room for a
HOT update on the same page. When playing around with variants or
even re-executing the same query, it matters how much free space
there is on the page containing the target tuple, and that is
affected by all sorts of seemingly-irrelevant actions.
Anyway, we do now have a simple and reliable reproducer, so we can
work on fixing this. Thanks again for the report!
regards, tom lane