Re: Review: rollback sequence reset for TRUNCATE ... RESTART IDENTITY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
Cc: Marc Cousin <cousinmarc(at)gmail(dot)com>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Review: rollback sequence reset for TRUNCATE ... RESTART IDENTITY
Date: 2010-11-17 21:24:06
Message-ID: 24101.1290029046@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Steve Singer <ssinger(at)ca(dot)afilias(dot)info> writes:
> I will look at addressing this in an updated patch.

I've nearly finished revising the patch already, don't worry about it.

>> Should currval really be used after a failed transaction ? Right now, we can
>> have a value that has been generated inside a rollbacked transaction too. I'd
>> vote for leave it alone.

> I agree probably shouldn't be using curval after a failed transaction

Well, people can do that now, and it doesn't throw an error. I'm
inclined to agree with Marc that just leaving it alone (ie, it returns
the last value produced, whether the transaction rolls back or not)
is the best thing. There's inherently going to be some inconsistency
here, since there's no such thing as a transactional sequence change
otherwise. I don't see the point of going way out of our way to move
the inconsistencies around.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2010-11-17 21:43:32 Re: unlogged tables
Previous Message Steve Crawford 2010-11-17 21:19:10 Re: unlogged tables