Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 70A6965035E for ; Wed, 3 Dec 2008 15:29:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 70176-04 for ; Wed, 3 Dec 2008 15:29:35 -0400 (AST) X-Greylist: delayed 00:06:38.172282 by SQLgrey-1.7.6 Received: from outboundproxy8.bluehost.com (outboundproxy7.bluehost.com [66.147.243.8]) by mail.postgresql.org (Postfix) with SMTP id B88E4650350 for ; Wed, 3 Dec 2008 15:29:34 -0400 (AST) Received: (qmail 12554 invoked by uid 0); 3 Dec 2008 19:22:36 -0000 Received: from unknown (HELO fast22.fastdomain.com) (74.220.199.22) by outboundproxy7.bluehost.com.bluehost.com with SMTP; 3 Dec 2008 19:22:36 -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=z63IzGmnUAZYNku5473tZQ/03SnfpSkcXrsIF/7fzwMg2urv4jIGQCJOazLPcXgszi+li+nY0hVnUX2az5rBc1js7KjytyKYK+wVWyv5pmsJMLveUgLRdMIU/q6rhyOd; Received: from idefix.cs.umass.edu ([128.119.245.108]) by fast22.fastdomain.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1L7xJD-0007JD-HZ; Wed, 03 Dec 2008 12:22:51 -0700 Message-ID: <4936DC8D.6070100@frogthinker.org> Date: Wed, 03 Dec 2008 14:22:53 -0500 From: Emmanuel Cecchet Organization: Frog Thinker User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Heikki Linnakangas CC: Tom Lane , 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> <48ECBBC2.6060003@frogthinker.org> <29132.1223475486@sss.pgh.pa.us> <48EFA13C.2060407@frogthinker.org> <490F804A.60108@enterprisedb.com> <490FB4B3.908@frogthinker.org> <49106B10.2090407@enterprisedb.com> <4910DFC0.3080301@frogthinker.org> <4914CD14.2060608@frogthinker.org> <4921C42A.3030600@enterprisedb.com> <492221A3.1060608@frogthinker.org> <4922A798.7050709@enterprisedb.com> <49232993.1050801@enterprisedb.com> <49243376.2000404@frogthinker.org> <492543D5.9050904@enterprisedb.com> <492B377F.4080602@frogthinker.org> <49344E22.2000008@frogthinker.org> <4934A4E0.8080208@frogthinker.org> <49364AFB.5060404@enterprisedb.com> In-Reply-To: <49364AFB.5060404@enterprisedb.com> 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 128.119.245.108 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: 200812/169 X-Sequence-Number: 128798 I would really like to have support for temp tables at least for the case where the table is created and dropped in the same transaction. But I guess that the other limitations on index, sequences and views would still hold, right? manu Heikki Linnakangas wrote: > Emmanuel Cecchet wrote: >> There is a problem with temp tables with on delete rows that are >> created inside a transaction. >> Take the 2pc_on_delete_rows_transaction.sql test case and change the >> creation statement, instead of >> create temp table foo(x int) on commit delete rows; >> try >> create temp table foo(x serial primary key) on commit delete rows; >> >> The test will fail. It looks like the onCommit field is not properly >> updated when serial or primary key is used in that context. I did not >> figure out why. > A serial column uses a sequence behind the scenes. > > Hmm. Seems like we would need to treat sequences and indexes the same > as tables with ON COMMIT DELETE ROWS, i.e release the locks early and > don't error out. > > All in all, this is getting pretty messy. My patch felt a bit hackish > to begin with, and having to add special cases for sequences and > indexes would make it even more so. And what about temporary views? > I'm starting to feel that instead of special-casing temp relations, we > need to move into the opposite direction and make temp relations more > like regular relations. Unfortunately, that's not going to happen in > the 8.4 timeframe :-(. Let's try the other approach in 8.5. > -- Emmanuel Cecchet FTO @ Frog Thinker Open Source Development & Consulting -- Web: http://www.frogthinker.org email: manu@frogthinker.org Skype: emmanuel_cecchet