Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 438471337B68 for ; Tue, 7 Dec 2010 16:23:21 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 31433-10 for ; Tue, 7 Dec 2010 20:23:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from marajade.localdomain (vcs5.camavision.com [63.228.164.252]) by mail.postgresql.org (Postfix) with ESMTP id 92E011337B54 for ; Tue, 7 Dec 2010 16:23:13 -0400 (AST) Received: from [192.168.10.84] (unknown [192.168.10.84]) (Authenticated sender: andy) by marajade.localdomain (Postfix) with ESMTPA id 194AE40E40; Tue, 7 Dec 2010 14:23:11 -0600 (CST) Message-ID: <4CFE97B4.8090708@squeakycode.net> Date: Tue, 07 Dec 2010 14:23:16 -0600 From: Andy Colson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Kenneth Marshall CC: Richard Broersma , Justin Pitts , pgsql-performance@postgresql.org Subject: Re: Compared MS SQL 2000 to Postgresql 9.0 on Windows References: <378e24d1e3af88a49fbbb7c4d26f441a@mail.gmail.com> <4CFE7964.80206@squeakycode.net> <4CFE8E59.2010505@squeakycode.net> <20101207201028.GE4028@aart.is.rice.edu> In-Reply-To: <20101207201028.GE4028@aart.is.rice.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201012/93 X-Sequence-Number: 41545 On 12/7/2010 2:10 PM, Kenneth Marshall wrote: > On Tue, Dec 07, 2010 at 11:56:51AM -0800, Richard Broersma wrote: >> On Tue, Dec 7, 2010 at 11:43 AM, Andy Colson wrote: >> >>> In PG the first statement you fire off (like an "insert into" for example) >>> will start a transaction. ?If you dont commit before you disconnect that >>> transaction will be rolled back. ?Even worse, if your program does not >>> commit, but keeps the connection to the db open, the transaction will stay >>> open too. >> >> Huh - is this new? I always thought that every statement was wrapped >> in its own transaction unless you explicitly start your own. So you >> shouldn't need to commit before closing a connection if you never >> opened a transaction to begin with. >> >> >> -- >> Regards, >> Richard Broersma Jr. >> > > The default of autocommit unless explicitly starting a transaction with > BEGIN is the normal behavior that I have seen as well. > > Cheers, > Ken Crikey! You're right. I need to be more careful with my assumptions. I maintain that people need to be more careful with pg transactions. I've seen several posts about "idle in transaction". But its not as bad as I made out. My confusion comes from the library I use to hit PG, which fires off a "begin" for me, and if I dont explicitly commit, it gets rolled back. sorry, it was confused between framework and PG. -Andy