Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8654D650214 for ; Mon, 1 Dec 2008 16:57:37 -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 49642-08 for ; Mon, 1 Dec 2008 16:57:30 -0400 (AST) X-Greylist: delayed 00:06:38.319872 by SQLgrey-1.7.6 Received: from outbound-mail-20.bluehost.com (outbound-mail-20.bluehost.com [69.89.20.235]) by mail.postgresql.org (Postfix) with SMTP id AC111650212 for ; Mon, 1 Dec 2008 16:57:28 -0400 (AST) Received: (qmail 9452 invoked by uid 0); 1 Dec 2008 20:50:44 -0000 Received: from unknown (HELO fast22.fastdomain.com) (74.220.199.22) by outboundproxy1.bluehost.com with SMTP; 1 Dec 2008 20:50:44 -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=fqC174SmpIHPJR3DkHdNWiSeGvDUjjkfmRkHzH+tu3wlls+0erGJOcD4WofZsWko0N/ezk3KQWNCky19vR2f7FJnDDQ4rVUbwVA/yDcOwis+Uoxso1Wv5rFxoOkFauns; Received: from c-71-192-35-139.hsd1.ma.comcast.net ([71.192.35.139] helo=[192.168.0.12]) by fast22.fastdomain.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1L7Fj9-0005VW-Jo; Mon, 01 Dec 2008 13:50:43 -0700 Message-ID: <49344E22.2000008@frogthinker.org> Date: Mon, 01 Dec 2008 15:50:42 -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> In-Reply-To: <492B377F.4080602@frogthinker.org> 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: 200812/49 X-Sequence-Number: 128678 Heikki, I think that the Assert in is_temp_rel(Oid) in tablecmds.c should be replaced by if (on_commits == NULL) return false; As the use case below shows, a regular table can be created and hold a LOCKTAG_RELATION lock that will trigger the call to is_temp_rel in is_preparable_locktag. The assert will break if no temp table was accessed. As we were also trying to list potential issues, if the temp table uses a SERIAL type, will there be potentially a problem with the sequence at prepare time? Emmanuel > The following test fails with your patch on my system. Could you check > if you can reproduce? > > psql (8.4devel) > Type "help" for help. > > test=# begin; > BEGIN > test=# create table paul(x int); > CREATE TABLE > test=# insert into paul values(1); > INSERT 0 1 > test=# prepare transaction 'persistentTableShouldSucceed'; > server closed the connection unexpectedly > This probably means the server terminated abnormally > before or while processing the request. > The connection to the server was lost. Attempting reset: Failed. > > --- > > LOG: database system is ready to accept connections > TRAP: FailedAssertion("!(on_commits != ((void *)0))", File: > "tablecmds.c", Line: 7823) > LOG: server process (PID 15969) was terminated by signal 6: Aborted > LOG: terminating any other active server processes > FATAL: the database system is in recovery mode > > > Thanks, > manu > -- Emmanuel Cecchet FTO @ Frog Thinker Open Source Development & Consulting -- Web: http://www.frogthinker.org email: manu@frogthinker.org Skype: emmanuel_cecchet