darcy(at)druid(dot)net (D'Arcy J.M. Cain) writes:
> I have tons of old files with names like base/db/pg_sorttemp####.##. I
> assume that they are temporary sorting files but somehow they never got
> cleared out. Is it safe to delete these from a running system. The files
> are months old.
The first #### is the PID of the backend that made them. If there is no
such backend anymore according to ps, it's safe to zap 'em. I'd rely on
that much more than the mod date.
BTW, if you are seeing unreclaimed sorttemp files in a recent release
(7.0 or later), I'd like to know about it. That shouldn't happen,
short of a backend crash anyway...
regards, tom lane