| От | Adrian 'Dagurashibanipal' von Bidder |
|---|---|
| Тема | Re: SERIAL behaviour |
| Дата | |
| Msg-id | 1026743373.15937.1.camel@atlas обсуждение исходный текст |
| Ответ на | Re: SERIAL behaviour (Martijn van Oosterhout <kleptog@svana.org>) |
| Список | pgsql-general |
On Mon, 2002-07-15 at 16:07, Martijn van Oosterhout wrote: > On Mon, Jul 15, 2002 at 03:47:28PM +0200, Adrian 'Dagurashibanipal' von Bidder wrote: > > On Sun, 2002-07-14 at 03:59, Eugene wrote: > > [ SERIAL type / SEQUENCEs and transactions ] > > > > Closely related: what's the official/preferred way if I'm inserting rows > > into a table with a auto assigned id (SERIAL), to get the newly created > > id? asking the sequence obviously will not work - as the sequence will > > advance when the next value is inserted from another transaction. > > You read the documentation and notice that currval() is not affected by > nextval()s executed upon other connections. In other words, it's a complete > non-issue and works exectly the way that is useful. Ok, thanks (and sorry for not rtfm in this case). Unexpected, but, yes, useful. cheers -- vbi -- secure email with gpg http://fortytwo.ch/gpg
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера