| От | Dev Elop |
|---|---|
| Тема | Re: [GENERAL] get the previous assigned sequence value |
| Дата | |
| Msg-id | 00e301bf4231$4a586140$1001a8c0@client обсуждение исходный текст |
| Ответ на | get the previous assigned sequence value (Kevin Heflin <kheflin@shreve.net>) |
| Ответы |
Re: [GENERAL] get the previous assigned sequence value
Re: [GENERAL] get the previous assigned sequence value |
| Список | pgsql-general |
> > > > After an INSERT, I want to retrieve the value of the sequence I use for > > unique_ids > > ... > > Alternatively, use the currval(mytable_id_seq) function within the same > session immediately after the insert. > With this second method, you'd probably need to beware race conditions. If another process inserts a record into mytable after you do but before you call currval(), then you'll get the wrong value. Not an issue if you've only got one process accessing the table - probably is one if you have two or more. - Richard Huxton
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера