Re: global temporary tables - Mailing list pgsql-hackers

From Tom Lane
Subject Re: global temporary tables
Date
Msg-id 18126.1272159451@sss.pgh.pa.us
Whole thread Raw
In response to Re: global temporary tables  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: global temporary tables  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> 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.  Maybe what we could do
> is incorporate the backend ID or PID into the file name when the
> relation is temp.  Then we could scan for and nuke such files pretty
> easily.  Otherwise 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.  The 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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [RFC] nodeToString format and exporting the SQL parser
Next
From: Jim Nasby
Date:
Subject: Re: global temporary tables