Re: including PID or backend ID in relpath of temp rels - Mailing list pgsql-hackers

From Robert Haas
Subject Re: including PID or backend ID in relpath of temp rels
Date
Msg-id v2n603c8f071004260317y588fbac3l8cd78457ce466@mail.gmail.com
Whole thread Raw
In response to Re: including PID or backend ID in relpath of temp rels  (Jaime Casanova <jcasanov@systemguards.com.ec>)
List pgsql-hackers
On Sun, Apr 25, 2010 at 10:19 PM, Jaime Casanova
<jcasanov@systemguards.com.ec> wrote:
> On Sun, Apr 25, 2010 at 8:07 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>>
>> 1. We could move the responsibility for removing the files associated
>> with temp rels from the background writer to the owning backend.  I
>> think the reason why we initially truncate the files and only later
>> remove them is because somebody else might have 'em open, so it
>> mightn't be necessary for temp rels.
>>
>
> what happens if the backend crash and obviously doesn't remove the
> file associated with temp rels?

Currently, they just get orphaned.  As I understand it, if the catalog
entry survives the crash, autovacuum will remove them 2 BILLION
transactions later (and emit warning messages in the meantime);
otherwise we won't even know they're there.

As I further understand it, the main point of this change is that if
temporary tables have a distinctive name of some kind, then when we
can run through the directory and blow away files with those names
without fearing that it's *permanent* table data that somehow got
orphaned.

...Robert


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: recovery_connections cannot start
Next
From: Robert Haas
Date:
Subject: Re: CIText and pattern_ops