Re: Invoice number

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Invoice number
Дата
Msg-id Pine.BSF.4.21.0012210905420.86012-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Invoice number  (Kaare Rasmussen <kar@webline.dk>)
Список pgsql-sql
> I'm wondering how people creates guaranteed sequential numbers - in my case 
> for invoice numbers.
> 
> - Sequences are not rollback'able.
> - It seems overkill to have a table just for this.
> - What else?

You'll probably need a table (although you may be able to get away with
only one for all of these you want to do).  The big issue here is locking
since a second transaction looking to get a number needs to wait for 
an earlier transaction that has already gotten a number to either commit
or rollback to reuse the number if necessary.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump Error
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Create table doesn't work in plpgsql