Re: [GENERAL] re-using RETURNING

2009-11-16 Thread Jasen Betts
On 2009-11-12, A. Kretschmer wrote: > Hi, > > just to be sure, it is still (8.4) not possible to use RETURNING within an > other INSERT? not in pure SQL, but it should be possible in PLPGSQL etc. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subs

Re: [GENERAL] re-using RETURNING

2009-11-15 Thread Andreas Kretschmer
Andreas Kretschmer wrote: > A. Kretschmer wrote: > > > Hi, > > > > just to be sure, it is still (8.4) not possible to use RETURNING within an > > other INSERT? > > Thx for all replies. It is not a really problem, i will write a > benchmark to compare the new writeable CTE (in 8.5 alpha) with

Re: [GENERAL] re-using RETURNING

2009-11-12 Thread Andreas Kretschmer
A. Kretschmer wrote: > Hi, > > just to be sure, it is still (8.4) not possible to use RETURNING within an > other INSERT? Thx for all replies. It is not a really problem, i will write a benchmark to compare the new writeable CTE (in 8.5 alpha) with the old style (8.4). That's all ;-) And yes,

Re: [GENERAL] re-using RETURNING

2009-11-12 Thread Craig Ringer
On 12/11/2009 9:41 PM, A. Kretschmer wrote: > Hi, > > just to be sure, it is still (8.4) not possible to use RETURNING within an > other INSERT? Not directly, now. However, if I recall correctly in 8.4 you *CAN* use a ... RETURNING statement within an SQL function, and use the results of that in

Re: [GENERAL] re-using RETURNING

2009-11-12 Thread Emanuel Calvo Franco
2009/11/12 A. Kretschmer : > Hi, > > just to be sure, it is still (8.4) not possible to use RETURNING within an > other INSERT? > > To show what i mean: > > test=*# insert into foo2 (id1, id2) (insert into foo(n) values > ('a'),('b'),('c') returning currval('some_sequence'), id); > ERROR:  syntax

Re: [GENERAL] re-using RETURNING

2009-11-12 Thread Grzegorz Jaśkiewicz
On Thu, Nov 12, 2009 at 1:41 PM, A. Kretschmer < andreas.kretsch...@schollglas.com> wrote: > Hi, > > just to be sure, it is still (8.4) not possible to use RETURNING within an > other INSERT? > > it is being discussed for 8.5, but as far as features go - stable versions don't change (at least chan

[GENERAL] re-using RETURNING

2009-11-12 Thread A. Kretschmer
Hi, just to be sure, it is still (8.4) not possible to use RETURNING within an other INSERT? To show what i mean: test=*# insert into foo2 (id1, id2) (insert into foo(n) values ('a'),('b'),('c') returning currval('some_sequence'), id); ERROR: syntax error at or near "insert" LINE 1: insert int