Re: [INTERFACES] locking on database updates - Mailing list pgsql-interfaces

From Joseph Shraibman
Subject Re: [INTERFACES] locking on database updates
Date
Msg-id 384C781E.F165774F@selectacast.net
Whole thread Raw
In response to Re: [INTERFACES] locking on database updates  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [INTERFACES] locking on database updates  (Douglas Thomson <dougt@mugc.cc.monash.edu.au>)
List pgsql-interfaces
Tom Lane wrote:

> Gary Stainburn <gary.stainburn@ringways.co.uk> writes:
> > My question is this.  Is there a safe way of retrieving the next
> > number from the parameter table in such a way that the same number
> > cannot be retrieved twice.
>
> Use a SEQUENCE object for each "parameter table".  This gives you
> a well-tested, efficient generator mechanism.  It may be "auto
> generated" but you do have the option of resetting the sequence's
> nextval and so forth, so I don't see that there is a good reason
> to build a SEQUENCE substitute by hand.
>
>                         regards, tom lane
>
> ************

Can you give an example of sql that creates a table with that?



pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: [INTERFACES] locking on database updates
Next
From: Douglas Thomson
Date:
Subject: Re: [INTERFACES] locking on database updates