Serial - last value

From: "hendra kusuma" <penguinroad(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Serial - last value
Date: 2008-11-20 09:00:37
Message-ID: 26dadb3d0811200100m5670a630td9364e4deeb5a85a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonatan Evald Buus 2008-11-20 09:07:00 row-level security (Dynamically rewrite queries)
Previous Message Albe Laurenz 2008-11-20 08:56:54 Re: Prepared statement already exists