X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 95A5C476022 for ; Wed, 23 Apr 2003 16:28:48 -0400 (EDT) Received: from wolff.to (wolff.to [66.93.249.74]) by postgresql.org (Postfix) with SMTP id CB4B9475F2C for ; Wed, 23 Apr 2003 16:28:47 -0400 (EDT) Received: (qmail 14841 invoked by uid 500); 23 Apr 2003 20:29:26 -0000 Date: Wed, 23 Apr 2003 15:29:26 -0500 From: Bruno Wolff III To: the2@newsgroup2.com Cc: pgsql-sql@postgresql.org Subject: Re: Ok,, what about cache for SEQUENCE - where? how? Message-ID: <20030423202926.GA13462@wolff.to> Mail-Followup-To: the2@newsgroup2.com, pgsql-sql@postgresql.org References: <525670e62aba2d75120f5657c77add8b@news.teranews.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <525670e62aba2d75120f5657c77add8b@news.teranews.com> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-38.6 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/354 X-Sequence-Number: 13055 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 .