Re: Example of RETURNING clause to get auto-generated keys from INSERT - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Example of RETURNING clause to get auto-generated keys from INSERT
Date
Msg-id 20070124204302.GC19495@wolff.to
Whole thread Raw
In response to Re: Example of RETURNING clause to get auto-generated keys from INSERT  ("Adam Rich" <adam.r@sbcglobal.net>)
List pgsql-general
On Tue, Jan 23, 2007 at 23:19:47 -0600,
  Adam Rich <adam.r@sbcglobal.net> wrote:
>
> And your normal query would be this:
>
> INSERT into mytable (id,value) values (1,"foo"),(2,"bar");
>
> Your new query would be like this:
>
> INSERT into mytable (id,value) values (1,"foo"),(2,"bar")
> RETURNING id;

Note that you will want to be using single quotes not double quotes.

pgsql-general by date:

Previous
From: marcelo Cortez
Date:
Subject: Re: capacity of tables
Next
From: Rich Shepard
Date:
Subject: Re: Cannot Restart PostgreSQL-8.1.4