Rollback sequence reset on TRUNCATE rollback patch

Started by Steve Singerover 15 years ago2 messageshackers
Jump to latest
#1Steve Singer
steve@ssinger.info

The attached patch modifies TRUNCATE ... RESTART IDENTITY so that if the
transaction rolls back the restart of the sequence will also be rolled back.

It follows the general outline discussed at
http://archives.postgresql.org/pgsql-hackers/2008-05/msg00550.php of
assigning a new reffilenode to the sequence.

I will add this to the next commitfest.

Steve

Attachments:

truncate_restart.difftext/x-patch; name=truncate_restart.diffDownload+122-140
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Steve Singer (#1)
Re: Rollback sequence reset on TRUNCATE rollback patch

Steve Singer <ssinger@ca.afilias.info> writes:

The attached patch modifies TRUNCATE ... RESTART IDENTITY so that if the
transaction rolls back the restart of the sequence will also be rolled back.

Applied with significant editorialization (didn't much like the
refactoring you'd chosen for DefineSequence, and there were some
other issues).

regards, tom lane