Serial - last value - Mailing list pgsql-general

From hendra kusuma
Subject Serial - last value
Date
Msg-id 26dadb3d0811200100m5670a630td9364e4deeb5a85a@mail.gmail.com
Whole thread Raw
Responses Re: Serial - last value
List pgsql-general
Hi there
a little basic question here

I usually use something like this in stored function
to get the last value of a serial type column

select last_value into ret from id_sequence
return ret


What i'm asking is,
if many people run the same stored function at the same time
will they get the last_value they should really get
or is there another way to code that can ensure they really get the right value

Thank you
Regards
Hendra

pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: Prepared statement already exists
Next
From: "Jonatan Evald Buus"
Date:
Subject: row-level security (Dynamically rewrite queries)