Re: Remove sort files - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Remove sort files
Date
Msg-id 200105231633.f4NGXVV15395@candle.pha.pa.us
Whole thread Raw
In response to Remove sort files  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Remove sort files  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Why don't we put the sort files into /tmp and let the system figure out
> > how to get rid of them?
>
> Hard-wiring the assumption that they should be in /tmp would be VASTLY
> worse than our current situation.  Lots of people run with /tmp its own,
> not very large partition.  There are also serious security issues on
> machines that don't have directory stickybits.
>
> I do not like the way Bruce is doing the find, either, but moving stuff
> to /tmp isn't the answer.
>
> One reasonable idea is
>
>     cd pg_sorttemp ; rm -f *
>
> which could potentially fail if there are LOTS of dead temp files
> (enough to make the expanded rm command overrun your kernel limit on
> command length) but if there are that many then you've got serious
> problems anyway.

OK, here is the new 'find' line:

"find \"%s\"/base -name pg_sorttemp ! -type f -exec /bin/sh -c \"cd {}; rm -f *\" \\;",
               

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Remove sort files
Next
From: Tom Lane
Date:
Subject: Re: Remove sort files