Re: Ok,, what about cache for SEQUENCE - where? how? - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: Ok,, what about cache for SEQUENCE - where? how?
Date
Msg-id 20030423202926.GA13462@wolff.to
Whole thread Raw
In response to Ok,, what about cache for SEQUENCE - where? how?  (foo2@on-spammers2.com)
List pgsql-sql
On Mon, Apr 21, 2003 at 04:25:44 +0000, foo2@on-spammers2.com wrote:
> The postgreSQL docs wave dire warnigns about the cache setting; if it
> is greater than one, apparently, sequences don't work (or at least,
> they work in a manner that isn't useful in the same way.)

Yes they will still work usefully for what they are supposed to be
used for. The will give you unique identifiers. You are more likely
to get gaps this way, but you can get gaps anyway and shouldn't
expect sequences to give you gap free lists of unique identifiers.

> But the docs fail to point out where one could set, or even learn
> about, the cache setting. A search of the docs for "cache" turns up
> quite apparently useless references.

This is described in the documentation for the create sequence and alter
sequence commands.

> 
> So - where is the cache setting, and if that's only part of the
> answer, how does one see what it is set to? If it's set to two or
> more, how does one set it back to one so sequences will be guaranteed
> to work?

You can use select cache_value from sequence_name .



pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Why is seq search preferred here by planner?
Next
From: Josh Berkus
Date:
Subject: Re: Optomizing left outer joins