Re: Remove sort files - Mailing list pgsql-patches

From Tom Lane
Subject Re: Remove sort files
Date
Msg-id 17184.990647867@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove sort files  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> What about CLUSTER?  If we do DROP COLUMN by creating a new heap, we
> will use it then too, right?  Are those the only two that create new
> files that could be orphaned?

It's not practical to detect files that are orphaned in that sense:
you couldn't do it without scanning pg_class, which the postmaster is
unprepared to do.  Far more important, trying to clean up such files
automatically is a HORRIBLY bad idea.  If anything goes wrong, the thing
will probably delete your entire database (for example: because pg_log
lossage causes it to believe all pg_class tuples are uncommitted).
That's a loose cannon I do not wish to have on our decks.

Auto-deletion of sorttemp files is a safe endeavor because (a) you can
reliably tell which ones those are by name, and (b) there's no
possibility that you wanted the data in them.  Neither condition holds
for data files.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Remove sort files
Next
From: Bruce Momjian
Date:
Subject: Re: [JDBC] ANT fix for jar creation