Re: Review: rollback sequence reset for TRUNCATE ... RESTART IDENTITY - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Review: rollback sequence reset for TRUNCATE ... RESTART IDENTITY
Date
Msg-id 24101.1290029046@sss.pgh.pa.us
Whole thread Raw
In response to Re: Review: rollback sequence reset for TRUNCATE ... RESTART IDENTITY  (Steve Singer <ssinger@ca.afilias.info>)
List pgsql-hackers
Steve Singer <ssinger@ca.afilias.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


pgsql-hackers by date:

Previous
From: Steve Crawford
Date:
Subject: Re: unlogged tables
Next
From: "Joshua D. Drake"
Date:
Subject: Re: unlogged tables