Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id BEEBF632DF3 for ; Sun, 25 Apr 2010 09:57:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 53086-03 for ; Sun, 25 Apr 2010 12:57:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail149084.authsmtp.net (outmail149084.authsmtp.net [62.13.149.84]) by mail.postgresql.org (Postfix) with ESMTP id 17103632239 for ; Sun, 25 Apr 2010 09:57:25 -0300 (ADT) Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt8.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id o3PCvNdr008102; Sun, 25 Apr 2010 13:57:23 +0100 (BST) Received: from [192.168.0.2] (88-110-156-192.dynamic.dsl.as9105.com [88.110.156.192]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id o3PCvLL5072103; Sun, 25 Apr 2010 13:57:21 +0100 (BST) Subject: Re: global temporary tables From: Simon Riggs To: Robert Haas Cc: pgsql-hackers@postgresql.org In-Reply-To: References: <1272148142.4161.1598.camel@ebony> <1272181795.4161.1604.camel@ebony> Content-Type: text/plain Date: Sun, 25 Apr 2010 13:57:21 +0100 Message-Id: <1272200241.4161.1670.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Server-Quench: 16a85fca-506a-11df-80b9-0022640b883e X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksadBtFagBbbElD HGQLWlREUV57XGR/ aQgfZQ1DY0tOQQRv VlZIS1BNEQ1vHhxP WR1+IV8OCwBGf3xx ZUUsXXZcXAp7cxd1 RxgHRHADZWExdWEe BBZFfwMGeR5Kfh1H bFR/BnsFYjBJBC9q VzwTFhsSEA9kHWxa RgYHJFZaXUsOBjkm TgoTVSkmF0kIXE0A X-Authentic-SMTP: 61633235383639.1015:706/Kp X-AuthFastPath: 0 (Was 255) X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. 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: 201004/1155 X-Sequence-Number: 161267 On Sun, 2010-04-25 at 06:50 -0400, Robert Haas wrote: > On Sun, Apr 25, 2010 at 3:49 AM, Simon Riggs wrote: > > On Sat, 2010-04-24 at 19:01 -0400, Robert Haas wrote: > > > >> There is one major problem, though: assigning a > >> scratch relfilenode to the temporary table requires generating an OID, > >> which we currently have no way to allow on the standby. > > > > Why not have an unlogged counter, which resets each system start, using > > same datatype as an oid. There's no necessity for the relfilenode to be > > an actual oid is there? > > > > That way we could use it on standbys also. > > I don't think that quite works, because the standby might assign a > relfilenode number for a global temp table and then the master might > subsequently assign the same relfilenode number to a regular table. > We might be able to make that not matter, but it's far from obvious to > me that there are no gotchas there... That sounds fairly simple to solve. All I am saying is please include "working on the standby" as part of your requirement. -- Simon Riggs www.2ndQuadrant.com