pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Roland Walter <roland.walter.rwa@gmx.net>
To: Albe Laurenz <all@adv.magwien.gv.at>
Cc: Dave Cramer *EXTERN* <pg@fastcrypt.com>
Cc: Peter Neu <peter.neu@gmx.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Efficient Insert statement for one record into multiple
Date: Mon, 18 Dec 2006 17:22:37 +0100
Message-ID: <4586C04D.5070008@gmx.net> (raw)
In-Reply-To: <52EF20B2E3209443BC37736D00C3C1380BF08124@EXADV1.host.magwien.gv.at>
References: <52EF20B2E3209443BC37736D00C3C1380BF08124@EXADV1.host.magwien.gv.at>

-----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-----



view thread (13+ messages)  latest in thread

Message-ID: <4586C04D.5070008@gmx.net>
Permalink:  ../4586C04D.5070008@gmx.net/
Also on:    postgresql.org/message-id/4586C04D.5070008@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: roland.walter.rwa@gmx.net, all@adv.magwien.gv.at, pg@fastcrypt.com, peter.neu@gmx.net
  Subject: Re: Efficient Insert statement for one record into multiple
  In-Reply-To: <4586C04D.5070008@gmx.net>
  References: <52EF20B2E3209443BC37736D00C3C1380BF08124@EXADV1.host.magwien.gv.at> <4586C04D.5070008@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox