On Fri, 20 Jun 2003, Raf wrote:

> I haven't used postgres for a while, but I used to use something like
> select(next_val(my_sequence)) and then insert this in or something along
> those lines.  If you find the sp I mean, which grabs the next id in the
> sequence id, it'll work for you..

How safe is this in environments where lots of separate processes, using 
separate connections to the database, are updating the same table?

With the MySQL insert_id method you get the result of a completed 
insertion so you know for certain what it is.

If you grab the number in advance isn't there a risk that another process 
will insert a record first and get the sequence number you're expecting?

Jason Clifford
-- 
UKFSN.ORG               Finance Free Software while you surf the 'net
http://www.ukfsn.org/                   Sign up now


Reply via email to