Re: [GENERAL] Serial - last value

2008-11-20 Thread Richard Huxton
hendra kusuma wrote: > > Let me get this clear > it should looks like this? > > create function something() returns integer as $$ > declare > ret integer; > begin > -- just assume something table has a serial column as primary key > insert into something values ('a value'); > select currv

Re: [GENERAL] Serial - last value

2008-11-20 Thread Richard Huxton
hendra kusuma wrote: > 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 funct

[GENERAL] Serial - last value

2008-11-20 Thread hendra kusuma
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