Re: How to create "auto-increment" field WITHOUT a sequence object?

Поиск
Список
Период
Сортировка
Искать
От
Dmitriy Igrishin
Тема
Re: How to create "auto-increment" field WITHOUT a sequence object?
Дата
Msg-id
CAAfz9KOKZVDQ1+thWEt+87ai2QEV6s4qgFG1ETHVt1mD6TM=ZA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
How to create "auto-increment" field WITHOUT a sequence object? Dmitry Koterov <dmitry.koterov@gmail.com>
Re: How to create "auto-increment" field WITHOUT a sequence object? Craig Ringer <craig@postnewspapers.com.au>
Re: How to create "auto-increment" field WITHOUT a sequence object? Ireneusz Pluta <ipluta@wp.pl>
Re: How to create "auto-increment" field WITHOUT a sequence object? Chris Travers <chris.travers@gmail.com>
Re: How to create "auto-increment" field WITHOUT a sequence object? Vincent de Phily <vincent.dephily@mobile-devices.fr>
Re: How to create "auto-increment" field WITHOUT a sequence object? Chris Travers <chris.travers@gmail.com>
Re: How to create "auto-increment" field WITHOUT a sequence object? Dmitriy Igrishin <dmitigr@gmail.com>
Re: How to create "auto-increment" field WITHOUT a sequence object? Chris Travers <chris.travers@gmail.com>
Re: How to create "auto-increment" field WITHOUT a sequence object? Craig Ringer <craig@postnewspapers.com.au>
Re: How to create "auto-increment" field WITHOUT a sequence object? Dmitriy Igrishin <dmitigr@gmail.com>
Re: How to create "auto-increment" field WITHOUT a sequence object? Vincent Veyron <vv.lists@wanadoo.fr>
Re: How to create "auto-increment" field WITHOUT a sequence object? Dmitriy Igrishin <dmitigr@gmail.com>
Re: How to create "auto-increment" field WITHOUT a sequence object? Vincent Veyron <vv.lists@wanadoo.fr>
Re: How to create "auto-increment" field WITHOUT a sequence object? Alban Hertroys <dalroi@solfertje.student.utwente.nl>
Re: How to create "auto-increment" field WITHOUT a sequence object? Dmitriy Igrishin <dmitigr@gmail.com>
Re: How to create "auto-increment" field WITHOUT a sequence object? Dmitriy Igrishin <dmitigr@gmail.com>
Hey Vincent,

2011/7/3 Vincent Veyron <vv.lists@wanadoo.fr>
Le vendredi 01 juillet 2011 à 12:28 +0400, Dmitriy Igrishin a écrit :


> Then I don't clearly understand the existence of locks (the LOCK
> command, SELECT FOR UPDATE clause and so on) if the usage
> of them gives only problems...
>

Chris already explained why twice :

"you MUST lock on insert to get gapless sequences"
Not me :-). The OP must do it. So, what problem here? Deadlocks?
Again, if deadlocks are so dangerous, why the LOCK command exists?


Can't you just :
-create the records with a regular sequence, that will have gaps
-when you want to export, number an additional column from 1 to 10 000
and use that as key
?
I don't use any locks explicitly :-)
--
Vincent Veyron
http://marica.fr/
Logiciel de gestion des sinistres et des contentieux pour le service juridique




--
// Dmitriy.


В списке pgsql-general по дате отправления
От: Vincent Veyron
Дата:
От: Ireneusz Pluta
Дата:
FAQ