INSERT ... RETURNING as Oracle - Mailing list pgsql-general

From Sipos Andras
Subject INSERT ... RETURNING as Oracle
Date
Msg-id 005101c0a413$83815900$0401a8c0@mzperx.hu
Whole thread Raw
Responses Re: INSERT ... RETURNING as Oracle
Re: INSERT ... RETURNING as Oracle
List pgsql-general
Hi,

Sample table:

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

Can I how to make in one step insert into the table and get values of 'ID' ?
I find similar solution then oracle's INSERT ... RETURNING.

If first make INSERT, and after SELECT MAX(ID), then result is uncertain.

my system version: 7.0.2

Thx,
Andras


pgsql-general by date:

Previous
From: Li Min Liu
Date:
Subject: chinese_big5 patches for PgAccess
Next
From: Josh Rovero
Date:
Subject: Re: PostgreSQL 7 on Solaris 8 - Is it working?