Thread: pgsql: Fix handling of pg_stat_statements.stat temporary file

pgsql: Fix handling of pg_stat_statements.stat temporary file

From
Magnus Hagander
Date:
Fix handling of pg_stat_statements.stat temporary file

Write the file to a temporary name and then rename() it into the
permanent name, to ensure it can't end up half-written and corrupt
in case of a crash during shutdown.

Unlink the file after it has been read so it's removed from the data
directory and not included in base backups going to replication slaves.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2b97db61dd0bffb0843eb2ea9be054d925e88ef1

Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c |   22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)