Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 779419FB1C3 for ; Wed, 7 Mar 2007 13:21:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 64210-03 for ; Wed, 7 Mar 2007 13:21:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from eppesuigoccas.homedns.org (host245-172-dynamic.0-87-r.retail.telecomitalia.it [87.0.172.245]) by postgresql.org (Postfix) with ESMTP id D4E779FB1D9 for ; Wed, 7 Mar 2007 13:21:12 -0400 (AST) Received: from 89-96-243-184.ip14.fastwebnet.it ([89.96.243.184] helo=scarafaggio) by eppesuigoccas.homedns.org with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1HOzlP-00021Y-9w for pgsql-jdbc@postgresql.org; Wed, 07 Mar 2007 18:17:19 +0100 Received: from giuseppe by scarafaggio with local (Exim 4.63) (envelope-from ) id 1HOzsv-0002WK-9p for pgsql-jdbc@postgresql.org; Wed, 07 Mar 2007 18:25:05 +0100 Subject: Re: Transaction atomicity From: Giuseppe Sacco To: pgsql-jdbc@postgresql.org In-Reply-To: <45EEEA1C.5050105@enterprisedb.com> References: <45EEEA1C.5050105@enterprisedb.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 07 Mar 2007 18:25:05 +0100 Message-Id: <1173288305.20645.67.camel@scarafaggio> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.991 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200703/80 X-Sequence-Number: 16794 Hi Heikki, Il giorno mer, 07/03/2007 alle 16.36 +0000, Heikki Linnakangas ha scritto: [...] > If you don't want to have a two-field key, for example because you can't > change the schema you already have, you could still divide a range of > ids for each office when you create the sequence: > > CREATE SEQUENCE fooseq MINVALUE 10000000 MAXVALUE 19999999 NO CYCLE This is the same solution I was thinking of, and probably the best one. I checked that currently the application only loops an average of 4 times, so I don't have a real urgency of switching to sequences. I will implement this code in two weeks from now, since I should have enough time. Thanks again, Giuseppe P.S. Just a note, I will not specify "NO CYCLE" since it seems to be the default behaviour and since it seems oracle uses "NOCYCLE" in one word.