pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Grant <grant@conprojan.com.au>
To: pgsql-sql@postgresql.org
Subject: Re: Sequence behaviour.
Date: Wed, 20 Jun 2001 09:04:05 +1000 (EST)
Message-ID: <Pine.LNX.4.21.0106200901270.17073-100000@webster.conprojan.com.au> (raw)
In-Reply-To: <21972.992930993@sss.pgh.pa.us>

> > binary_data=# create sequence test;
> > CREATE
> > binary_data=# select nextval('test');
> > NOTICE:  test.nextval: sequence was re-created
> 
> Um, how did you get that NOTICE?  I don't see it.

This is version 7.0.3. I deleted the sequence first.

> Anyway, the answer to your question is that there's another bit of
> state in a sequence: the is_called flag is initially false and is
> set true during the first-ever nextval().  This allows nextval to
> deliver the specified start value on the first call, rather than
> the one after that.  In 7.1 setval() takes an optional third
> argument to reset the value of is_called...

Ok. Still a bit weird to me anyhow.

Thanks.




view thread (3+ messages)

Message-ID: <Pine.LNX.4.21.0106200901270.17073-100000@webster.conprojan.com.au>
Permalink:  ../Pine.LNX.4.21.0106200901270.17073-100000@webster.conprojan.com.au/
Also on:    postgresql.org/message-id/Pine.LNX.4.21.0106200901270.17073-100000@webster.conprojan.com.au

 · 

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-sql@postgresql.org
  Cc: grant@conprojan.com.au
  Subject: Re: Sequence behaviour.
  In-Reply-To: <Pine.LNX.4.21.0106200901270.17073-100000@webster.conprojan.com.au>
  References: <21972.992930993@sss.pgh.pa.us> <Pine.LNX.4.21.0106200901270.17073-100000@webster.conprojan.com.au>

* 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