From: Roland Walter <rwa@mosaic-ag.com>
To: Peter.Zoche@materna.de
Cc: pgsql-jdbc@postgresql.org
Subject: Re: INSERT and get ID
Date: Wed, 27 Jul 2005 15:53:01 +0200
Message-ID: <42E791BD.2030808@mosaic-ag.com> (raw)
In-Reply-To: <3617A3C21370D045B75C0A40A7A6530D0B37E19A@ntexc2buc.do-office.buc.materna.com>
References: <3617A3C21370D045B75C0A40A7A6530D0B37E19A@ntexc2buc.do-office.buc.materna.com>
Peter.Zoche@materna.de schrieb:
>>You have to do a a "SELECT curval('myseq')" after the insert.
>
>
> I had this in mind, too, but I am not sure if it is really safe if
> there are several inserts at the same time...
>
What do you mean with at the same time?
Different connections see different sequence values. So there is no
need to worry.
If you did the
insertions within the same connection, you have to ask the current value
of the sequence after each INSERT.
--
Roland Walter phone: +49 (0) 22 25 / 88 2-41 1
MOSAIC SOFTWARE AG fax: +49 (0) 22 25 / 88 2-20 1
Am Pannacker 3 mailto: rwa (at) mosaic-ag (dot) com
D-53340 Meckenheim http://www.mosaic-ag.com
------- L E G A L D I S C L A I M E R ---------
Die Informationen in dieser Nachricht sind vertraulich
und ausschliesslich fuer den Adressaten bestimmt.
Kenntnisnahme durch Dritte ist unzulaessig. Die
Erstellung von Kopien oder das Weiterleiten an weitere,
nicht originaere und benannte Adressaten ist nicht
vorgesehen und kann ungesetzlich sein. Die Meinungen
in dieser Nachricht stellen lediglich die Meinungen
des Senders dar. Falls Sie vermuten, dass diese
Nachricht veraendert wurde, setzen Sie sich mit dem
Absender in Verbindung. Der Absender uebernimmt ohne
weitere Ueberpruefung keine Verantwortung fuer die
Richtigkeit und Vollstaendigkeit des Inhalts. Unbefugte
Empfaenger werden gebeten, die Vertraulichkeit der
Nachricht zu wahren und den Absender sofort ueber
einen Uebertragungsfehler zu informieren.
------------------------------------------------------
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: rwa@mosaic-ag.com, Peter.Zoche@materna.de
Subject: Re: INSERT and get ID
In-Reply-To: <42E791BD.2030808@mosaic-ag.com>
References: <3617A3C21370D045B75C0A40A7A6530D0B37E19A@ntexc2buc.do-office.buc.materna.com> <42E791BD.2030808@mosaic-ag.com>
* 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