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

2007-01-24 Thread Bruno Wolff III
On Tue, Jan 23, 2007 at 23:19:47 -0600, Adam Rich <[EMAIL PROTECTED]> 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

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

2007-01-23 Thread Adam Rich
Of Ken Johanson Sent: Tuesday, January 23, 2007 10:50 PM To: pgsql-general@postgresql.org Subject: [GENERAL] Example of RETURNING clause to get auto-generated keys from INSERT Greetings, I am looking into possibly contributing some code for one of the existing PG drivers, that will allow

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

2007-01-23 Thread Alvaro Herrera
Ken Johanson wrote: > -support multiple values, ie. insert int tbl (a,b) values (1,2),(3,4), > should return a result with 2 rows containing the new keys (one for each > column the users declares). > -query the values atomically (so that insert by another client won't > skew the curval / sequen

[GENERAL] Example of RETURNING clause to get auto-generated keys from INSERT

2007-01-23 Thread Ken Johanson
Greetings, I am looking into possibly contributing some code for one of the existing PG drivers, that will allow us to, after INSERT, get a ResultSet containing the server generated keys (sequences or other). I've been told that (short of implementing a new V4 server protocol) the most effect