Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id D89EE9FB43C for ; Fri, 9 Mar 2007 06:03:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 66102-05 for ; Fri, 9 Mar 2007 06:03:35 -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 AA42E9FB6EB for ; Fri, 9 Mar 2007 06:03:38 -0400 (AST) Received: from eppesuig3wifi ([192.168.2.51] helo=scarafaggio ident=Debian-exim) by eppesuigoccas.homedns.org with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1HPLug-0001kS-AX for pgsql-jdbc@postgresql.org; Thu, 08 Mar 2007 17:56:22 +0100 Received: from giuseppe by scarafaggio with local (Exim 4.63) (envelope-from ) id 1HPM2S-0001Lj-Qk for pgsql-jdbc@postgresql.org; Thu, 08 Mar 2007 18:04:24 +0100 Subject: [OT] Re: Transaction atomicity From: Giuseppe Sacco To: pgsql-jdbc@postgresql.org In-Reply-To: <1173288305.20645.67.camel@scarafaggio> References: <45EEEA1C.5050105@enterprisedb.com> <1173288305.20645.67.camel@scarafaggio> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Lixper S.r.L. Date: Thu, 08 Mar 2007 18:04:24 +0100 Message-Id: <1173373464.5627.9.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=2.082 tagged_above=0 required=5 tests=BAYES_50, FORGED_RCVD_HELO, RCVD_IN_NJABL_DUL X-Spam-Level: ** X-Archive-Number: 200703/85 X-Sequence-Number: 16799 Il giorno mer, 07/03/2007 alle 18.25 +0100, Giuseppe Sacco ha scritto: > Hi Heikki, [...] > > 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. [a bit off topic] Just for the records: sql-server doesn't accept the max() solution, so I will have to implement the sequence way very quickly. The error I get is: errorCode=1046, sqlState= S1000 "Subqueries are not allowed in this context. Only scalar expressions are allowed" :-) Again, thanks to all, Giuseppe