Question reagarding serial type.

From: "Mirko Geffken" <mgeffken(at)corcoranweb(dot)com>
To: <pgsql-general(at)hub(dot)org>
Subject: Question reagarding serial type.
Date: 2000-06-08 13:37:09
Message-ID: 200006080937.AA224854588@corcoranweb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

i have tried to find info elsewhere, but did not find anything to my satisfaction, so I was wondering if anyone on this list could point me into the right direction.

When I create a table

e.g.:
create table xyz
(
id serial PRIMARY KEY,
uvw varchar2(100)
);

I would like to get the id returned when I insert into this table. In oracle it is possible to do this:
insert into xyz(uvw) values ('Test') returning id;

How can I do this with SQL in Postgres. Any ideas.

Thank you for any suggestions

Mirko

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-06-08 14:38:14 Re: Re: [SQL] oracle rownum equivalent?
Previous Message Kurt Seel 2000-06-08 13:27:56 two postgres servers on one machine?