Re: Removing pgsql_tmp files - Mailing list pgsql-general

From Tom Lane
Subject Re: Removing pgsql_tmp files
Date
Msg-id 218.1289250205@sss.pgh.pa.us
Whole thread Raw
In response to Removing pgsql_tmp files  (Michael Glaesemann <michael.glaesemann@myyearbook.com>)
Responses Re: Removing pgsql_tmp files  (Michael Glaesemann <michael.glaesemann@myyearbook.com>)
List pgsql-general
Michael Glaesemann <michael.glaesemann@myyearbook.com> writes:
> We've got over 250GB of files in a pgsql_tmp directory, some with modification timestamps going back to August 2010
whenthe server was last restarted. 

That's very peculiar.  Do you keep query logs?  It would be useful to
try to correlate the temp files' PIDs and timestamps with the specific
queries that must have created them.

> Does this query look reasonable? What other things should I take into account before I start deleting files from the
filesystem? Why might these files not be cleaned up on their own? 

Personally, I'd not risk trying to match on PID; it should be sufficient
to delete anything with a timestamp older than the oldest active
backend.  (Unless you've got some really long-lived sessions in
there...)

What PG version is this?

            regards, tom lane

pgsql-general by date:

Previous
From: Matthieu Huin
Date:
Subject: temporary table as a subset of an existing table and indexes
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: finding the other statement causing a sharelock