pgsql: Fix handling of pg_stat_statements.stat temporary file - Mailing list pgsql-committers

From Magnus Hagander
Subject pgsql: Fix handling of pg_stat_statements.stat temporary file
Date
Msg-id E1SYZLK-000720-TU@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2791f2180d8e7c469fac2a4d88fc449689e4c970

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


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Prevent synchronized scanning when systable_beginscan chooses a
Next
From: Magnus Hagander
Date:
Subject: pgsql: Make pg_recievexlog by default loop on connection failures