X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9F7DA329C83 for ; Wed, 22 Sep 2004 17:14:38 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 34996-04 for ; Wed, 22 Sep 2004 16:14:34 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 6B038329CB0 for ; Wed, 22 Sep 2004 17:14:33 +0100 (BST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i8MGEWfk035715 for ; Wed, 22 Sep 2004 16:14:33 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i8MGBhrt034751 for pgsql-admin@postgresql.org; Wed, 22 Sep 2004 16:11:43 GMT From: Gaetano Mendola X-Newsgroups: comp.databases.postgresql.admin Subject: Re: Getting the OID of inserted row in a rule Date: Wed, 22 Sep 2004 18:11:38 +0200 Organization: PYRENET Midi-pyrenees Provider Lines: 44 Message-ID: <4151A43A.2080805@bigfoot.com> References: <41517C66.9040709@kieser.net> <20040922152643.GA92429@winnie.fuhr.org> <41519A7E.8050803@kieser.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@pyrenet.fr To: Bradley Kieser User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en In-Reply-To: <41519A7E.8050803@kieser.net> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/210 X-Sequence-Number: 14913 Bradley Kieser wrote: > Hi Michael, > > But what if another insert happens in the mean time? Then the sequence > would have advanced that the data will be scrambled. |Given that this > could be a very active dataset, that situation is almost certain to occur. > I think you are wrong, the sequence are not affected by transactions ( on rollback the serial is not rolledback ), but however the value are isolated between transactions. I don't see the problem: #section1 begin; insert into test (b) values ( 1 ); #section2 begin; insert into test (b) values ( 1 ); #section1 select currval('test_a_seq'); <==== give 1 #section2 select currval('test_a_seq'); <==== give 2 Regards Gaetano Mendola