Sequence behaviour.

From: Grant <grant(at)conprojan(dot)com(dot)au>
To: pgsql-sql(at)postgresql(dot)org
Subject: Sequence behaviour.
Date: 2001-06-19 05:12:51
Message-ID: Pine.LNX.4.21.0106191506230.8263-100000@webster.conprojan.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Why is the following like it is? I would think that nextval would return 2
in both instances, am I missing something here? :) Thanks!

binary_data=# create sequence test;
CREATE
binary_data=# select nextval('test');
NOTICE: test.nextval: sequence was re-created
nextval
---------
1
(1 row)

binary_data=# select setval('test', 1);
setval
--------
1
(1 row)

binary_data=# select nextval('test');
nextval
---------
2
(1 row)

binary_data=#

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-06-19 06:09:53 Re: Sequence behaviour.
Previous Message Josh Berkus 2001-06-19 02:33:52 A cute little function