pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: K Parker <kparker@eudoramail.com>
To: pgsql-general@hub.org
Subject: Re: sequences
Date: Thu, 21 Sep 2000 10:18:51 -0700
Message-ID: <BFLLMHFDNEPNCAAA@shared1-mail.whowhere.com> (raw)

Perhaps I was too brief before, wanting to spare folks long quotes from the manual that we all have, but here goes (quoting from http://www.postgresql.org/users-lounge/docs/7.0/postgres/sql-createsequence.htm):

"After a sequence is created, you may use the  function nextval(seqname) to get a new number from the sequence. The function currval('seqname') may be used to determine the number returned by the last call to nextval(seqname) for the specified sequence _in the current session_".  [emphasis added]

"Unexpected results may be obtained if a cache setting greater than one is used for a sequence object that will be used
 concurrently by multiple backends. Each backend will allocate and cache successive sequence values during one access to
 the sequence object and increase the sequence object's last_value accordingly. Then, the next cache-1 uses of nextval within
 that backend simply return the preallocated values without touching the shared object. So, numbers allocated but not used in
 the current session will be lost. __Furthermore, although multiple backends are guaranteed to allocate distinct sequence values,
 the values may be generated out of sequence when all the backends are considered.__" [again, emphasis added].


Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com



view thread (16+ messages)  latest in thread

Message-ID: <BFLLMHFDNEPNCAAA@shared1-mail.whowhere.com>
Permalink:  ../BFLLMHFDNEPNCAAA@shared1-mail.whowhere.com/
Also on:    postgresql.org/message-id/BFLLMHFDNEPNCAAA@shared1-mail.whowhere.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: kparker@eudoramail.com, pgsql-general@hub.org
  Subject: Re: sequences
  In-Reply-To: <BFLLMHFDNEPNCAAA@shared1-mail.whowhere.com>
  References: <BFLLMHFDNEPNCAAA@shared1-mail.whowhere.com>

* 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