Peter Blair <petertblair@gmail.com> writes:
> One other problem with this case, those 900K worth of files in each of the
> table and index directories (1.8M total files) are still hanging around.
Hm ... if left to its own devices, I think the session that created them
should have deleted them, assuming you did a normal query cancel on it.
Maybe you did kill -9?
> Just a guess, but do I shutdown the database, and delete any file not
> listed in pg_class?
For starters, try just stopping and starting the database; I think there
might be logic to remove orphaned files during postmaster startup.
If that doesn't work, you can get rid of any numeric-named files that
match no value in pg_class.relfilenode of their database.
regards, tom lane