Re: [GENERAL] cannot use result of (insert .. returning)

2008-08-14 Thread Dale Harris
2008 17:59 To: Dale Harris Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] cannot use result of (insert .. returning) Hello you can wrap INSERT STATEMENT into function. Than you can do anything with result; create table f(a timestamp); postgres=# select * from (insert into

Re: [GENERAL] cannot use result of (insert .. returning)

2008-08-14 Thread Pavel Stehule
Hello you can wrap INSERT STATEMENT into function. Than you can do anything with result; create table f(a timestamp); postgres=# select * from (insert into f values(current_timestamp) returning *) x where x.a > now(); ERROR: syntax error at or near "into" LINE 1: select * from (insert into f va

Re: [GENERAL] cannot use result of (insert .. returning)

2008-08-14 Thread Dale Harris
I've found my solution as in the help file under "RETURNING INTO". It would be nice if this was referenced on the INSERT documentation. Dale From: [EMAIL PROTECTED] Sent: Thursday, 14 August 2008 15:32 To: pgsql-general@postgresql.org Subject: [GENERAL] cannot use re

[GENERAL] cannot use result of (insert .. returning)

2008-08-13 Thread Dale Harris
Hello, I'm having the same issues as dvs had in message thread http://archives.postgresql.org/pgsql-general/2008-05/msg01117.php as I want to be able to use the result from an INSERT INTO table(...) VALUES(...) RETURNING new_row_ID. I would ideally like to be able to capture the RETURNING v

Re: [GENERAL] cannot use result of (insert .. returning)

2008-05-31 Thread dvs
I need to use query like: ,c from anytable where condition but it say ERROR: syntax error at or near "into" did you try with: select (insert into test (a) values (x) returning b) query_a JOIN c ON ... ? you about select * from (insert into test (a) values (x) returning b) z ? it get t

Re: [GENERAL] cannot use result of (insert .. returning)

2008-05-30 Thread Tino Wildenhain
dvs wrote: Hello, I need to use query like: ,c from anytable where condition but it say ERROR: syntax error at or near "into" did you try with: select (insert into test (a) values (x) returning b) query_a JOIN c ON ... ? Tino. smime.p7s Description: S/MIME Cryptographic Signature

[GENERAL] cannot use result of (insert .. returning)

2008-05-30 Thread dvs
Hello, I need to use query like: select (insert into test (a) values (x) returning b),c from anytable where condition but it say ERROR: syntax error at or near "into" Is this a bug? Function does not work too: create function addt(..) returning .. as 'insert ... returning ..' language