Getting Primary Key Value After Insert

Поиск
Список
Период
Сортировка
От Adam
Тема Getting Primary Key Value After Insert
Дата
Msg-id 003e01c6a310$2916eb90$0200a8c0@PANASONIULSWMR
обсуждение исходный текст
Ответ на Re: Long term database archival  (Richard Broersma Jr <rabroersma@yahoo.com>)
Ответы Re: Getting Primary Key Value After Insert  ("Nikolay Samokhvalov" <samokhvalov@gmail.com>)
Список pgsql-general
I'm inserting data into two tables, the second table has a forigen key that
points to the primary key of the first table.

After I insert a row into the first table, I need to take the primary key
value created in "SERIAL" column and store it so I can insert it as the
forigen key value on the second table.

What is the best way to get the value of the primary key ( SERIAL data
type ) of the row I inserted?


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

Предыдущее
От: howachen@gmail.com
Дата:
Сообщение: Is OpenFTS dead?
Следующее
От: "Adam"
Дата:
Сообщение: Re: Getting Primary Key Value After Insert