Re: [GENERAL] [PGSQL 8.2.x] INSERT+INSERT

2007-06-22 Thread Gregory Stark
"Vincenzo Romano" <[EMAIL PROTECTED]> writes: >> Or wrap it around SQL function: > > That's the way I'm doind now even if in a slightly different way. > 20+ million calls will badly slooow down the DB insertions Are you sure? How much? > and require you to know the exact name of the implicit se

Re: [GENERAL] [PGSQL 8.2.x] INSERT+INSERT

2007-06-22 Thread PFC
I think it would be greatly helpful if the insert...returning could be seen as a "select" statement and, thus, being usable in the way I have described. I suspect that the insert...returning is actually implemented as an inser plus a select. You can create a function which does the INSERT RET

Re: [GENERAL] [PGSQL 8.2.x] INSERT+INSERT

2007-06-22 Thread Vincenzo Romano
On Thursday 21 June 2007 15:47:17 Dawid Kuroczko wrote: > On 6/21/07, Vincenzo Romano <[EMAIL PROTECTED]> wrote: > > Hi all. > > I'd like to do the following: > > > > insert into t1 > > values ( > > 'atextvalue',( > > insert into t2 > > values ( 'somethingelse' ) > > ret

Re: [GENERAL] [PGSQL 8.2.x] INSERT+INSERT

2007-06-21 Thread Dawid Kuroczko
On 6/21/07, Vincenzo Romano <[EMAIL PROTECTED]> wrote: Hi all. I'd like to do the following: insert into t1 values ( 'atextvalue',( insert into t2 values ( 'somethingelse' ) returning theserial ) ) ; that is, I first insert data into t2 getting back the newly c

[GENERAL] [PGSQL 8.2.x] INSERT+INSERT

2007-06-21 Thread Vincenzo Romano
Hi all. I'd like to do the following: insert into t1 values ( 'atextvalue',( insert into t2 values ( 'somethingelse' ) returning theserial ) ) ; that is, I first insert data into t2 getting back the newly created serial values, then i insert this values in anoth