Re: [GENERAL] get inserted id from transaction - PG 9.2

2017-02-14 Thread Patrick B
2017-02-15 12:19 GMT+13:00 Tom Lane : > Patrick B writes: > > I'm simply doing an insert and I want to get the inserted id with a > select. > > I'm doing this all in the same transactions. > > > Example: > > BEGIN; > > INSERT INTO test (id,name,description) VALUES (default,'test 1','testing > > i

Re: [GENERAL] get inserted id from transaction - PG 9.2

2017-02-14 Thread Tom Lane
Patrick B writes: > I'm simply doing an insert and I want to get the inserted id with a select. > I'm doing this all in the same transactions. > Example: > BEGIN; > INSERT INTO test (id,name,description) VALUES (default,'test 1','testing > insert'); > SELECT FROM test ORDER BY id DESC; -- I don't

Re: [GENERAL] get inserted id from transaction - PG 9.2

2017-02-14 Thread Steve Atkins
> On Feb 14, 2017, at 2:55 PM, Patrick B wrote: > > Hi all, > > I'm simply doing an insert and I want to get the inserted id with a select. > I'm doing this all in the same transactions. > > Example: > > BEGIN; > > INSERT INTO test (id,name,description) VALUES (default,'test 1','testing >

Re: [GENERAL] get inserted id from transaction - PG 9.2

2017-02-14 Thread David G. Johnston
On Tue, Feb 14, 2017 at 3:55 PM, Patrick B wrote: > Hi all, > > I'm simply doing an insert and I want to get the inserted id with a > select. I'm doing this all in the same transactions. > > Example: > > BEGIN; > > > INSERT INTO test (id,name,description) VALUES (default,'test 1','testing > inser

[GENERAL] get inserted id from transaction - PG 9.2

2017-02-14 Thread Patrick B
Hi all, I'm simply doing an insert and I want to get the inserted id with a select. I'm doing this all in the same transactions. Example: BEGIN; INSERT INTO test (id,name,description) VALUES (default,'test 1','testing insert'); SELECT FROM test ORDER BY id DESC; -- I don't see the inserted ro