Re: Last Id? - Mailing list pgsql-novice

From Tom Lane
Subject Re: Last Id?
Date
Msg-id 14081.1125978675@sss.pgh.pa.us
Whole thread Raw
In response to Last Id?  (Jan Danielsson <jan.danielsson@gmail.com>)
Responses Re: Last Id?  (Michael Fuhr <mike@fuhr.org>)
List pgsql-novice
Jan Danielsson <jan.danielsson@gmail.com> writes:
>    I have seen a few "currval", "last_value", tricks and such, but they
> aren't good enough, AFAICT, since they only work when I can guarantee
> that no one else will insert a new record between the time that I insert
> one, and query for the last_value.

You evidently do not understand how currval works.  It is session-local,
so the race condition you are imagining does not exist.

            regards, tom lane

pgsql-novice by date:

Previous
From: "Jessica Broomans"
Date:
Subject: howto to do an automated backup on windows xp?
Next
From: Michael Glaesemann
Date:
Subject: Re: Last Id?