From: | Joseph Shraibman <jks(at)p1(dot)selectacast(dot)net> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>, "'Pgsql Interfaces'" <pgsql-interfaces(at)postgreSQL(dot)org> |
Subject: | Re: [INTERFACES] locking on database updates |
Date: | 1999-12-07 02:59:42 |
Message-ID: | 384C781E.F165774F@selectacast.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
Tom Lane wrote:
> Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)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?
From | Date | Subject | |
---|---|---|---|
Next Message | Douglas Thomson | 1999-12-07 03:58:43 | Re: [INTERFACES] locking on database updates |
Previous Message | Tom Lane | 1999-12-07 01:14:21 | Re: [INTERFACES] locking on database updates |