Clean up after erroneous SELECT FOR UPDATE/SHARE on a sequence.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: f0d72ef638899ea1042e895c0573ba1d4af4d942
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2011-06-02T19:31:28Z
Releases: 8.2.22
Clean up after erroneous SELECT FOR UPDATE/SHARE on a sequence.

My previous commit disallowed this operation, but did nothing about
cleaning up the damage if one had already been done.  With the operation
disallowed, it's okay to just forcibly clear xmax in a sequence's tuple,
since any value seen there could not represent a live transaction's lock.
So, any sequence-specific operation will repair the problem automatically,
whether or not the user has already seen "could not access status of
transaction" failures.

Files

PathChange+/−
src/backend/commands/sequence.c modified +16 −0