Re: Ok,, what about cache for SEQUENCE - where? how?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: the2(at)newsgroup2(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Ok,, what about cache for SEQUENCE - where? how?
Date: 2003-04-23 20:29:26
Message-ID: 20030423202926.GA13462@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Apr 21, 2003 at 04:25:44 +0000,
foo2(at)on-spammers2(dot)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 .

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2003-04-23 20:51:53 Re: Optomizing left outer joins
Previous Message Josh Berkus 2003-04-23 20:21:06 Re: Why is seq search preferred here by planner?