Re: Remove sort files

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Remove sort files
Date: 2001-05-23 15:33:48
Message-ID: 200105231533.f4NFXmx08116@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-05-23 15:50:32 Re: Remove sort files
Previous Message Peter Eisentraut 2001-05-23 15:05:47 Re: Remove sort files