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

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Ok,, what about cache for SEQUENCE - where? how?
Дата
Msg-id 20030423202926.GA13462@wolff.to
обсуждение исходный текст
Ответ на Ok,, what about cache for SEQUENCE - where? how?  (foo2@on-spammers2.com)
Список 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 по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Why is seq search preferred here by planner?
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Optomizing left outer joins