Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5D5C937BE34 for ; Wed, 8 Oct 2008 10:55:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41051-04-6 for ; Wed, 8 Oct 2008 10:55:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outbound-mail-136.bluehost.com (outbound-mail-136.bluehost.com [67.222.39.26]) by postgresql.org (Postfix) with SMTP id CC14437C1A8 for ; Wed, 8 Oct 2008 10:55:18 -0300 (ADT) Received: (qmail 927 invoked by uid 0); 8 Oct 2008 13:55:13 -0000 Received: from unknown (HELO fast22.fastdomain.com) (74.220.199.22) by outboundproxy4.bluehost.com with SMTP; 8 Oct 2008 13:55:13 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=frogthinker.org; h=Received:Message-ID:Date:From:Organization:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=xtGnemt46bV4YrvfNA65kpsb+uRUHLOhmmd07RYuwPcliY+A8WhHEeHvICFVJFa3tFHTdUC8qR5/kgYv2AO8jV6eS26v9NYkgSaYgfLDdEyTxIevilz0ZUBvGW/j76/U; Received: from c-71-192-35-139.hsd1.ma.comcast.net ([71.192.35.139] helo=[192.168.0.14]) by fast22.fastdomain.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1KnZVR-0007X4-E2; Wed, 08 Oct 2008 07:55:13 -0600 Message-ID: <48ECBBC2.6060003@frogthinker.org> Date: Wed, 08 Oct 2008 09:55:14 -0400 From: Emmanuel Cecchet Organization: Frog Thinker User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Tom Lane CC: Heikki Linnakangas , pgsql-hackers@postgresql.org Subject: Re: Transactions and temp tables References: <48EA7B12.6050906@frogthinker.org> <48EB0551.50205@enterprisedb.com> <48EB95B7.10604@frogthinker.org> <48EC7EB5.5020001@enterprisedb.com> <48ECAA8F.3070306@frogthinker.org> <28137.1223472191@sss.pgh.pa.us> In-Reply-To: <28137.1223472191@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Identified-User: {2846:fast22.fastdomain.com:frogthin:frogthinker.org} {sentby:smtp auth 71.192.35.139 authed with manu+frogthinker.org} X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/323 X-Sequence-Number: 125340 Tom Lane wrote: > Emmanuel Cecchet writes: > >> Thanks for the example, I get it now. Does it make sense to allow any >> request execution between PREPARE TRANSACTION and the subsequent COMMIT >> or ROLLBACK? >> > > Yes. Don't even think of trying to disallow that. The COMMIT doesn't > even have to happen in the same session, anyway. > Ok, so actually I don't see any different behavior between a temp table or a regular table. The locking happens the same way and as long as the commit prepared happens (potentially in another session), the lock is released at commit time which seems to make sense. The issue that Heikki was mentioning about the server not shutting down seems to happen as soon as you have a single transaction that has prepared commit but not commit/rollback yet. This seems also independent of whether you are using a temp table or not. It seems that the patch did not alter the behavior of PG in that regard. What do you think? Emmanuel