Search Postgresql Archives

Re: Example of RETURNING clause to get auto-generated keys from INSERT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 23, 2007 at 23:19:47 -0600,
  Adam Rich <adam.r@xxxxxxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux