Re: Last_Inserted Value

From: Andre Schubert <andre(dot)schubert(at)km3(dot)de>
To: Marin Dimitrov <marin(dot)dimitrov(at)sirma(dot)bg>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Last_Inserted Value
Date: 2002-03-28 12:37:48
Message-ID: 3CA30E9C.A45A5557@km3.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Marin Dimitrov schrieb:
>
> ----- 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

Oh thanks for your advice, i exactly use this transaction isolation
level.

>
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Radoslaw Stachowiak 2002-03-28 14:34:19 7.2 timetz/time/current_time improper behaviour report
Previous Message Marin Dimitrov 2002-03-28 11:11:39 Re: Last_Inserted Value