Re: Insert and obtain the pk

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Insert and obtain the pk
Дата
Msg-id Pine.LNX.4.44.0311061951290.29650-100000@peter.localdomain
обсуждение исходный текст
Ответ на Insert and obtain the pk  ("Eliu Montoya" <eliu@itam.mx>)
Список pgsql-general
Eliu Montoya writes:

> Does anyone know an easy way to  insert a record (without a value for the
> primary key because it is a sequence)  and at the same time obtain the value
> of primary key that was assign to this new record.

If you know the name of the sequence then you can use the function
currval() to get the last assigned value in your session.

--
Peter Eisentraut   peter_e@gmx.net


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Install files for version 7.4
Следующее
От: "Carlos Oliva"
Дата:
Сообщение: Re: Install files for version 7.4