Re: Efficient Insert statement for one record into multiple

From: "Albe Laurenz" <all(at)adv(dot)magwien(dot)gv(dot)at>
To: "Dave Cramer *EXTERN*" <pg(at)fastcrypt(dot)com>, "Peter Neu" <peter(dot)neu(at)gmx(dot)net>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Efficient Insert statement for one record into multiple
Date: 2006-12-18 15:36:11
Message-ID: 52EF20B2E3209443BC37736D00C3C1380BF08124@EXADV1.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

>> If I got you right I cannot link this two insert statements together.
>> So I need two times to open a prepared statement and execute it.
>> Would I need to do this in a transaction or is it safe to do this
>> without it?
>
> It's safe to do it without a transaction, what you have to make sure
> is that you do it with the same connection object.

Safe as far as currval() is concerned, yes, but then the second
INSERT could fail while the first INSERT is committed, right?

Yours,
Laurenz Albe

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Roland Walter 2006-12-18 16:22:37 Re: Efficient Insert statement for one record into multiple
Previous Message Albe Laurenz 2006-12-18 15:06:03 Re: Efficient Insert statement for one record into multiple