Re: problem in sequence

From: "Jason Minion" <jason(dot)minion(at)sigler(dot)com>
To: "Suvarna" <suvarnat(at)cygnus(dot)stpp(dot)soft(dot)net>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: problem in sequence
Date: 2006-03-01 17:23:22
Message-ID: 261CF9EEB14F5442894AB6DDA93AA6F40758EF@mail.siglercompanies.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

This is likely because transactions have been rolled back due to the
shutdown. Sequences operate *outside* of transaction space - operations
on a sequence will not be rolled back from a transaction, and a commit
has no effect. There is probably a better way to put that. However, they
should not be used when sequential numbers are necessary. Notice that
you can use functions on the same sequence across multiple transactions
concurrently, a lock is only necessary during the execution of the
function, not the transaction. If you do need distinct sequential number
generation, I would suggest an AFTER INSERT trigger that determines the
next value necessary. You would also need to lock the table
appropriately in that trigger. There will be performance penalties for
this.

You should also update/upgrade your PostgreSQL installation!!

Please see:

http://www.postgresql.org/docs/8.1/interactive/sql-createsequence.html

Jason Minion

________________________________

From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Suvarna
Sent: Monday, February 27, 2006 11:51 PM
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] problem in sequence

In postgresql 7.3.2 if the server shuts down abruptly then sequence does
not behave properly.
Next val after rebooting server shows gsp between last number & next val

Browse pgsql-admin by date

  From Date Subject
Next Message Jim C. Nasby 2006-03-01 19:21:33 Re: REINDEX during a transaction
Previous Message Tom Lane 2006-03-01 16:30:10 Re: [ADMIN] Reg:lo_open error..pls help me