]> granicus.if.org Git - postgresql/commit
Fix handling of pg_stat_statements.stat temporary file
authorMagnus Hagander <magnus@hagander.net>
Sun, 27 May 2012 08:54:31 +0000 (10:54 +0200)
committerMagnus Hagander <magnus@hagander.net>
Sun, 27 May 2012 08:58:14 +0000 (10:58 +0200)
commit2791f2180d8e7c469fac2a4d88fc449689e4c970
treef42123965177d69ec4bcce2ffbbe5ee04a477b41
parent6c1bf45ea50a652d2b8efa778cabb63fdf422e70
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.
contrib/pg_stat_statements/pg_stat_statements.c