Re: problem in sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx
[mailto:pgsql-admin-owner@xxxxxxxxxxxxxx] On Behalf Of Suvarna
Sent: Monday, February 27, 2006 11:51 PM
To: pgsql-admin@xxxxxxxxxxxxxx
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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux