Posgres13_beta1, is consistently writing to the logs, "could not rename temporary statistics file".
When analyzing the source that writes the log, I simplified the part that writes the logs a little.
1. I changed from if else if to if
2. For the user, better to have more errors recorded, which can help in discovering the problem
3. Errors are independent of each other
4. If I can't release tmpfile, there's no way to delete it (unlink)
5. If I can rename, there is no need to delete it (unlink) tmpfile.
Attached is the patch that proposes these changes.
Now, the problem has not been solved.
1. statfile, is it really closed or does it not exist in the directory?
There is no way to rename a file, which is open and in use.
2. Why delete (pgstat_stat_filename), if permanent is true:
const char * statfile = permanent? PGSTAT_STAT_PERMANENT_FILENAME: pgstat_stat_filename;
statfile is PGSTAT_STAT_PERMANENT_FILENAME and not pgstat_stat_filename
regards,
Ranier Vilela