Value of sequence last inserted

Поиск
Список
Период
Сортировка
От bryan@flyingiranch.com
Тема Value of sequence last inserted
Дата
Msg-id H00000660001d19c.1047308237.mule.flyingiranch.com@MHS
обсуждение исходный текст
Ответы Re: Value of sequence last inserted  (Joe Conway <mail@joeconway.com>)
Список pgsql-novice
I have a sequence that I am using on a field that I am using for the ID
of an item in a table. After an insert to that table, I need to insert
into two other tables using the same ID - does the initial insert
somehow return the value of the sequence that was used? I know it may
not be reliable to do, say "SELECT MAX ID FROM"..., so how can I assure
that I have the right ID for my other inserts? Should I just do the set
of inserts as a transaction?

Thanks,

Bryan

Вложения

В списке pgsql-novice по дате отправления:

Предыдущее
От: Vittorio Zuccala'
Дата:
Сообщение: Re: Pgaccess doesn't connect
Следующее
От: Tom Lane
Дата:
Сообщение: Re: select