Re: INSERT ... RETURNING in v8.2

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Allison <tom(at)tacocat(dot)net>
Cc: Vincenzo Romano <vincenzo(dot)romano(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: INSERT ... RETURNING in v8.2
Date: 2007-06-17 23:31:31
Message-ID: 20070617233131.GB3823@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Allison escribió:

> Holy Crud!
> you mean to tell me I can replace:
>
> insert into table(string) values(('one'),('two'),('three'));
> select idx from table where string in ('one','two','three');
>
> with
>
> insert into table(string) values(('one'),('two'),('three')) returning
> idx;
>
> ?????
>
> I realize that this is an extension to standard SQL but it sure would
> save me a lot.

You are wrong -- you can do it, but it is not an extension. It is in
the standard.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-06-18 00:20:54 Re: INSERT ... RETURNING in v8.2
Previous Message Ragnar 2007-06-17 22:25:47 Re: initdb