Re: Changing sequence cache - Mailing list pgsql-sql

From Dan Langille
Subject Re: Changing sequence cache
Date
Msg-id 200203041832.g24IW2k78903@lists.unixathome.org
Whole thread Raw
In response to Changing sequence cache  (Matthew Price <pricem@juno.com>)
List pgsql-sql
On 4 Mar 2002 at 18:02, Matthew Price wrote:

> I already have a sequence named customers_custid_seq
> 
> I would like to increase the cache setting some.  How can i alter the cache
> after the sequence has already been created?
> 
> Trying:
> update customer_custid_seq set cache=5;
> Gives this:
> ERROR:  You can't change sequence relation customer_custid_seq

test=# create sequence mprice;
CREATE

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

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

test=# select nextval('mprice');nextval
---------     24
(1 row)

test=#
-- 
Dan Langille
The FreeBSD Diary - http://freebsddiary.org/ - practical examples



pgsql-sql by date:

Previous
From: Matthew Price
Date:
Subject: Changing sequence cache
Next
From: Tom Lane
Date:
Subject: Uniqueness of rule, constraint, and trigger names