| От | Bruno Wolff III |
|---|---|
| Тема | Re: LAST_INSERT_ID equivalent |
| Дата | |
| Msg-id | 20030612192653.GA5756@wolff.to обсуждение |
| Ответ на | Re: LAST_INSERT_ID equivalent (Erik Price <eprice@ptc.com>) |
| Список | pgsql-general |
On Thu, Jun 12, 2003 at 15:17:22 -0400, Erik Price <eprice@ptc.com> wrote: > > So you're saying that you perform a pre-query to fetch the nextval, then > you include that in your query where you perform the INSERT? I see. > Since this is all part of the same transaction, the nextval value won't > overwrite another simultaneous INSERT, I assume. This seems like a good > way to do it too. I don't mind the holes in the sequence, but wouldn't > this INSERT cause the sequence to increment the primary key yet again? If you do things that way you specify a value for the serial column rather than let it default to using nextval.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера