Re: serial column vs. explicit sequence question

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: serial column vs. explicit sequence question
Дата
Msg-id 200206131404.28257.josh@agliodbs.com
обсуждение исходный текст
Ответ на serial column vs. explicit sequence question  (Charlie Toohey <ctoohey@pacbell.net>)
Список pgsql-sql
Charlie,

> Lets say I need to insert a row into the master table and N rows into the
> detail table. After inserting a row into master, and before detail, I need
to
> read the master table to obtain the value of the id for the row just
> inserted, so I can insert this id as the foreign key value for the N rows in
> the detail table.

Hey, what about CURRVAL('sequence_name')?

--
-Josh Berkus



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

Предыдущее
От: Vernon Wu
Дата:
Сообщение: Please help me out on this insert error
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: serial column vs. explicit sequence question