Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 854F3632DF3 for ; Sat, 24 Apr 2010 22:59:53 -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 95169-09 for ; Sun, 25 Apr 2010 01:59:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f202.google.com (mail-iw0-f202.google.com [209.85.223.202]) by mail.postgresql.org (Postfix) with ESMTP id 9654C632DA4 for ; Sat, 24 Apr 2010 22:59:42 -0300 (ADT) Received: by iwn40 with SMTP id 40so2184789iwn.1 for ; Sat, 24 Apr 2010 18:59:41 -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=cU+TCcuRco7qFFK9SGh3dGLUVkb3L5jmbok7BJBu6j8=; b=xVPsHTYFlQTuVfa6OqoCjtZ5VCkQ3+HQ1q5E50O/boyvwbluds0smCdnvEn0cmJDCX ITutiERGyD5Rek4j0h2KaKiq2KsE/Brp9e5n14nFU4CWtfG2nq1Bp1+ZKYMSzCvQA+7a 8wukoRLnvLB97wenU3+qebX6nHRyl3dZ7UMjo= 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=uAUvRQVl1KsmoUyUEjD0EXZUxLQwmHDjWklYxQc6Z82nt1bVtWq2TNBLFAfraxRswe dMyA31NovTurhOlGQLb7fWAaIbaJM63RtcwbnecPuhwIXe3EM8kwMWnNvqjsMDYBBJO2 ohQUF0ZIQ5IImQS8pApIFE8nWRwWbWN7U0Epk= MIME-Version: 1.0 Received: by 10.231.190.142 with SMTP id di14mr684554ibb.83.1272160781171; Sat, 24 Apr 2010 18:59:41 -0700 (PDT) Received: by 10.231.12.129 with HTTP; Sat, 24 Apr 2010 18:59:41 -0700 (PDT) In-Reply-To: <18126.1272159451@sss.pgh.pa.us> References: <7796.1272125493@sss.pgh.pa.us> <9319.1272130283@sss.pgh.pa.us> <18126.1272159451@sss.pgh.pa.us> Date: Sat, 24 Apr 2010 21:59:41 -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=-2.072 tagged_above=-10 required=5 tests=AWL=-0.172, BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201004/1143 X-Sequence-Number: 161255 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 places= . Eh? I don't see how it's going to do that. ...Robert