| От | Bruno Wolff III |
|---|---|
| Тема | Re: Insert race hazard condition. |
| Дата | |
| Msg-id | 20030325200759.GB14216@wolff.to обсуждение исходный текст |
| Ответ на | Insert race hazard condition. (Roy Souther <roy@SiliconTao.com>) |
| Список | pgsql-sql |
On Tue, Mar 25, 2003 at 13:01:17 -0700, Roy Souther <roy@SiliconTao.com> wrote: > First of all I am a programmer not an DBA expert. > > For a long time now when I create a table I have an index field that is > of type int4 to be the primary key. All of the queries and activity on > each record uses this field to do the posting, manipulating and reading > of data to and from tables. [snip] > Is there a better way to do this? How do DBAs with a lot of connections > safely create new records? The short answer is to use sequences. Use currval to get the value assigned earlier in the same transaction.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера