fetching the id of a new row

Поиск
Список
Период
Сортировка
От Jelle Ouwerkerk
Тема fetching the id of a new row
Дата
Msg-id Pine.NEB.4.10.10102081613240.3543-100000@what.openface.ca
обсуждение исходный текст
Ответы Re: fetching the id of a new row  ("Albert REINER" <areiner@tph.tuwien.ac.at>)
Список pgsql-sql
Hi,

How might I insert a new row into a table and return the id of the new row
all in the same SQL statement? The id is generated by a sequence. Up to
now I've been getting the nextval of the sequence first and then inserting
with the id in a second SQL exec. Is there a faster way (in a general
case, without writing SQL or plpgsql functions)?

Thanks





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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] PL/pgsql EXECUTE 'SELECT INTO ...'
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: parse error in create index