Re: problem in sequence

Поиск
Список
Период
Сортировка
От Jason Minion
Тема Re: problem in sequence
Дата
Msg-id 261CF9EEB14F5442894AB6DDA93AA6F40758EF@mail.siglercompanies.com
обсуждение исходный текст
Ответ на problem in sequence  ("Suvarna" <suvarnat@cygnus.stpp.soft.net>)
Список 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@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Suvarna
Sent: Monday, February 27, 2006 11:51 PM
To: pgsql-admin@postgresql.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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Reg:lo_open error..pls help me
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: REINDEX during a transaction