Skip site navigation (1) Skip section navigation (2)

Re: Sequence Number question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "nwalker(at)eldocomp(dot)com" <nwalker(at)eldocomp(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Sequence Number question
Date: 2004-07-01 02:45:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Naomi Walker <nwalke(at)eldocomp(dot)com> writes:
> We are using Postgres 7.3.2 on a Solaris box.
> When I dump a schema with a SEQUENCE in it, it shows the MAXVAL as 
> 2,147,483,647.

> Is it possible to set this number higher?

Hmm ... 7.3 does have support for 64-bit sequences, if it was compiled
on a compiler that has a 64-bit integer type.  If you just do

	create sequence s;
	select * from s;

what do you see for max_value?  If it's 2147483647, then you need to get
a better compiler and rebuild Postgres.  If it's 9223372036854775807
then you're good, and what you probably have is a sequence that was
dumped and reloaded from an older version of Postgres that didn't have
64-bit sequence support.  I don't think 7.3 has ALTER SEQUENCE, but you
could drop and recreate the sequence and then manually fix its current

> When we get to maxval, does it wrap?  

Not unless you said CYCLE.   Read the CREATE SEQUENCE man page.

			regards, tom lane

In response to

pgsql-admin by date

Next:From: vidhya baskaranDate: 2004-07-01 03:32:10
Subject: unsubscribe
Previous:From: BCS ComputersDate: 2004-06-30 22:18:59
Subject: unsubscribe

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group