Re: Improve cleaning files on Postgres crashes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improve cleaning files on Postgres crashes
Date: 2025-02-18 16:21:14
Message-ID: 1245549.1739895674@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> writes:
> There are some reports that Postgres does not handle correctly cleaning the
> files used when it crashes. [1]
> I think that function *fcloseall* can help a little bit.
> Mainly on Windows.

I doubt that this is a good thing to try to do during a panic exit.
In the first place, we don't know to what extent the process's
internal data structures may be corrupted, possibly causing
fcloseall itself to malfunction. In the second place, we might
wish to have a look at those temp files for debugging purposes.

I won't bother to address such points as whether fcloseall exists
everywhere or whether you put the calls in sane places.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-02-18 16:21:33 Re: Clarification on Role Access Rights to Table Indexes
Previous Message Tom Lane 2025-02-18 16:13:48 Re: [PATCH] snowball: fix potential NULL dereference