INSERT ... RETURNING as Oracle

Поиск
Список
Период
Сортировка
От Sipos Andras
Тема INSERT ... RETURNING as Oracle
Дата
Msg-id 004801c0a4df$d3e77ec0$0401a8c0@mzperx.hu
обсуждение исходный текст
Ответы Re: INSERT ... RETURNING as Oracle
Re: INSERT ... RETURNING as Oracle
Список pgsql-general
Hi,

Sample table:

create table basket (
  id   serial  NOT NULL PRIMARY KEY,
  timestamp  timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);

How can I make a one step insert into the table and get values of 'ID' ?
I am trying to find a similar solution as in the oracle's INSERT ...
RETURNING.

If I use at first the INSERT, and after SELECT MAX(ID), the result will be
uncertain.

my system version: 7.0.2

Thx,
Andras s-andras@freemail.hu



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

Предыдущее
От: will trillich
Дата:
Сообщение: Re: can a trigger on insert -> update other tables?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: INSERT ... RETURNING as Oracle