From: Marin Dimitrov <marin.dimitrov@sirma.bg>
To: Andre Schubert <andre.schubert@km3.de>
To: pgsql-admin@postgresql.org
Subject: Re: Last_Inserted Value
Date: Thu, 28 Mar 2002 13:11:39 +0200
Message-ID: <000501c1d649$55b47110$9b0e32d4@sirma.bg> (raw)
References: <3CA2CF1F.3451C5B4@km3.de>
----- Original Message -----
From: "Andre Schubert"
>
> Can i do a select id from foo order by id desc limit 1 before the end of
> the transaction,
> does this return exactly the row i inserted for this transaction?
>
only if u use SERIALIZABLE transaction isolation level - then the
transactions committed from other users *while* your transaction was in
progress are not visible
in the default READ COMMITED level other committed transactions will
interfere with the "select id from foo order by id desc limit 1" you'll
issue before the end of your transaction
take a look at "Read Committed and Serializable Isolation Levels" from
"PostgreSQL: Introduction and Concepts"
hth,
Marin
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-admin@postgresql.org
Cc: marin.dimitrov@sirma.bg, andre.schubert@km3.de
Subject: Re: Last_Inserted Value
In-Reply-To: <000501c1d649$55b47110$9b0e32d4@sirma.bg>
References: <3CA2CF1F.3451C5B4@km3.de> <000501c1d649$55b47110$9b0e32d4@sirma.bg>
* 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