pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joseph Shraibman <jks@p1.selectacast.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gary Stainburn <gary.stainburn@ringways.co.uk>
Cc: 'Pgsql Interfaces' <pgsql-interfaces@postgreSQL.org>
Subject: Re: [INTERFACES] locking on database updates
Date: Mon, 06 Dec 1999 21:59:42 -0500
Message-ID: <384C781E.F165774F@selectacast.net> (raw)
References: <20458.944529261@sss.pgh.pa.us>

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?




view thread (21+ messages)  latest in thread

Message-ID: <384C781E.F165774F@selectacast.net>
Permalink:  ../384C781E.F165774F@selectacast.net/
Also on:    postgresql.org/message-id/384C781E.F165774F@selectacast.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: jks@p1.selectacast.net, tgl@sss.pgh.pa.us, gary.stainburn@ringways.co.uk
  Subject: Re: [INTERFACES] locking on database updates
  In-Reply-To: <384C781E.F165774F@selectacast.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox