Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 0FEFB632A64 for ; Sat, 24 Apr 2010 23:23:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 00139-05 for ; Sun, 25 Apr 2010 02:23:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f221.google.com (mail-gx0-f221.google.com [209.85.217.221]) by mail.postgresql.org (Postfix) with ESMTP id 789EE63262C for ; Sat, 24 Apr 2010 23:23:19 -0300 (ADT) Received: by gxk21 with SMTP id 21so523391gxk.14 for ; Sat, 24 Apr 2010 19:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=lEaBeDWBTUesBLyre29rwlqBSdlTt///A+a5/P0sY94=; b=Y6EGU0kjj6H1yppp5BIrr1uAVoVgzeAfNaE+XmtZYHHLVWehEQ5hucaIClOzCOulC5 Gkes5rICFgWqlLlQKguK6z/NKg4xhR6HMPJmadeIJ8poGcLq6chURH67HK+iRF0hkPmd qMBM9nhQGOBGNtzJtyCzR7VerONLgLL7SZ9Ow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=aUukMRj3p5zU3vd5V0HwHM7fUeo/ASiJmF0Y2Qhi7QV5wg/Ny6CgMlB+8pSp63hFIl korzWPVguiOiJBoKpAEKVxlzakQtBMdnbmamKuwkAjAWj/SxzgAXfN1abq7EJdIC8t2/ lsxIqfqJChsT4EeAIQpk1Sg5Onj2qrxu2qUKA= MIME-Version: 1.0 Received: by 10.90.2.4 with SMTP id 4mr1327323agb.42.1272162179346; Sat, 24 Apr 2010 19:22:59 -0700 (PDT) Received: by 10.231.12.129 with HTTP; Sat, 24 Apr 2010 19:22:58 -0700 (PDT) In-Reply-To: References: <7796.1272125493@sss.pgh.pa.us> <9319.1272130283@sss.pgh.pa.us> <18126.1272159451@sss.pgh.pa.us> Date: Sat, 24 Apr 2010 22:22:58 -0400 Message-ID: Subject: Re: global temporary tables From: Robert Haas To: Tom Lane Cc: Jim Nasby , Greg Sabino Mullane , pgsql-hackers@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.372 tagged_above=-10 required=5 tests=AWL=-0.872, BAYES_05=-0.5 X-Spam-Level: X-Archive-Number: 201004/1144 X-Sequence-Number: 161256 On Sat, Apr 24, 2010 at 9:59 PM, Robert Haas wrote: > On Sat, Apr 24, 2010 at 9:37 PM, Tom Lane wrote: >> Robert Haas writes: >>> Unfortunately, I don't see much alternative to making smgr know >>> something about the temp-ness of the relation, though I'm hoping to >>> keep the smgr surgery to an absolute minimum. =A0Maybe what we could do >>> is incorporate the backend ID or PID into the file name when the >>> relation is temp. =A0Then we could scan for and nuke such files pretty >>> easily. =A0Otherwise I can't really think how to make it work. >> >> I think that could be a really good idea, mainly because it makes >> post-crash cleanup MUCH safer: you can tell with certainty from the >> filename that it's a leftover temp table. =A0The notion of zapping files >> just because we don't see them listed in pg_class has always scared the >> heck out of me. >> >> We already know temp-ness at pretty low levels, like bufmgr vs localbuf. >> Pushing it all the way down to smgr doesn't seem like a leap; in fact >> I think it would eliminate a separate isTemp parameter in a lot of place= s. > > Eh? =A0I don't see how it's going to do that. Oh, maybe I do see. If we pass it to smgropen() and stash it in the SMgrRelation, we don't have to keep supplying it later on, maybe? Will investigate further. ...Robert