Re: Roll Back dont roll back counters - Mailing list pgsql-general

From Richard Huxton
Subject Re: Roll Back dont roll back counters
Date
Msg-id 003501c12645$508559c0$1001a8c0@archonet.com
Whole thread Raw
In response to Roll Back dont roll back counters  ("Ben-Nes Michael" <miki@canaan.co.il>)
List pgsql-general
From: "Ben-Nes Michael" <miki@canaan.co.il>

> If I design a table with SERIAL type and then try to insert few rows, but
> some of the rows are rolled back the roll back process does not roll back
> the counter status.
>
> Is there a way to do a roll back to the counter ?

No - sequences (as used by the serial type) are merely guaranteed to provide
unique (increasing) numbers to each backend. They aren't designed for
producing (always) sequential numbers.

Check the mail archives for a long discussion about this with regard to
invoice numbers.

- Richard Huxton


pgsql-general by date:

Previous
From: Gunnar Rønning
Date:
Subject: Re: Re: Re: Storing images in PG?
Next
From: "Roderick A. Anderson"
Date:
Subject: Re: Roll Back dont roll back counters