Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 8B1379F9FE1 for ; Mon, 18 Dec 2006 12:22:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 05155-01 for ; Mon, 18 Dec 2006 12:22:39 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id B29959F9FB2 for ; Mon, 18 Dec 2006 12:22:38 -0400 (AST) Received: (qmail invoked by alias); 18 Dec 2006 16:22:37 -0000 Received: from xdsl-213-196-246-72.netcologne.de (EHLO [192.168.3.10]) [213.196.246.72] by mail.gmx.net (mp045) with SMTP; 18 Dec 2006 17:22:37 +0100 X-Authenticated: #2870507 Message-ID: <4586C04D.5070008@gmx.net> Date: Mon, 18 Dec 2006 17:22:37 +0100 From: Roland Walter User-Agent: Thunderbird 1.5.0.8 (X11/20060911) MIME-Version: 1.0 To: Albe Laurenz CC: Dave Cramer *EXTERN* , Peter Neu , pgsql-jdbc@postgresql.org Subject: Re: Efficient Insert statement for one record into multiple References: <52EF20B2E3209443BC37736D00C3C1380BF08124@EXADV1.host.magwien.gv.at> In-Reply-To: <52EF20B2E3209443BC37736D00C3C1380BF08124@EXADV1.host.magwien.gv.at> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/90 X-Sequence-Number: 16322 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Albe Laurenz wrote: >>> 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? Yes, but as I said, it depends of the application if you do the two insertions in one transaction. Regards, Roland. - -- Dipl.-Phys. Roland Walter mailto: roland (dot) walter (dot) rwa (at) gmx (dot) net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFFhsBMxoOEAkary1ERAlp2AJ97Sw/pKIPr7Lm4QPKBYg1wD4oQZwCdG/0r xmvivi1ApSuI8viTpcKbIS0= =A8ZT -----END PGP SIGNATURE-----