Re: Remove sort files - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Remove sort files
Date
Msg-id 200105231533.f4NFXmx08116@candle.pha.pa.us
Whole thread Raw
In response to Re: Remove sort files  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Remove sort files  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
> Bruce Momjian writes:
>
> > The only unusual part is the use of system("find...rm...") to remove the
> > files in pg_sorttemp.  Seemed cleaner than doing fancy directory
> > walking code in C.
>
> 'find' is not in the portable subset of shell utilities, AFAIK.  If you do
> put them into a separate directory you could use "rm -rf %s" on that
> directory.

I did it that way so if pg_sorttemp is a symlink, I don't remove the
symlink, just the files inside.  The 'find' needs to be updated though
to '! -file f' rather than '-type d' because it will not see symlinks,
and I am not sure the find symlink find flag is portable.

Anyway, I am still thinking about this.  I haven't addressed tables that
are orphaned by a rename aborting.

I am no where near ready to apply this yet.

>
> Why don't we put the sort files into /tmp and let the system figure out
> how to get rid of them?

I am concerned that /tmp has size limitations that /data doesn't.  I
know on my BSD/OS, it limits to 75MB because it is a memory-based file
system.

--
  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: Peter Eisentraut
Date:
Subject: Re: Remove sort files
Next
From: Tom Lane
Date:
Subject: Re: Remove sort files