aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2014-06-04 12:09:45 +0900
committerFujii Masao <fujii@postgresql.org>2014-06-04 12:09:45 +0900
commit654e8e444749f053c3bf3fd543d10deb6aa6dd09 (patch)
tree87c57a19d176372a374212294a524092b511bcf6
parent55fb759ab3e7543a6be72a35e6b6961455c5b393 (diff)
downloadpostgresql-654e8e444749f053c3bf3fd543d10deb6aa6dd09.tar.gz
postgresql-654e8e444749f053c3bf3fd543d10deb6aa6dd09.zip
Save pg_stat_statements statistics file into $PGDATA/pg_stat directory at shutdown.
187492b6c2e8cafc5b39063ca3b67846e8155d24 changed pgstat.c so that the stats files were saved into $PGDATA/pg_stat directory when the server was shutdowned. But it accidentally forgot to change the location of pg_stat_statements permanent stats file. This commit fixes pg_stat_statements so that its stats file is also saved into $PGDATA/pg_stat at shutdown. Since this fix changes the file layout, we don't back-patch it to 9.3 where this oversight was introduced.
-rw-r--r--contrib/pg_stat_statements/pg_stat_statements.c2
-rw-r--r--src/backend/postmaster/pgstat.c8
-rw-r--r--src/include/pgstat.h8
3 files changed, 9 insertions, 9 deletions
diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index 32d16cc5f3e..a3e8c595b81 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -80,7 +80,7 @@
PG_MODULE_MAGIC;
/* Location of permanent stats file (valid when database is shut down) */
-#define PGSS_DUMP_FILE "global/pg_stat_statements.stat"
+#define PGSS_DUMP_FILE PGSTAT_STAT_PERMANENT_DIRECTORY "/pg_stat_statements.stat"
/*
* Location of external query text file. We don't keep it in the core
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index f86481665f3..3ab1428f7c7 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -68,14 +68,6 @@
/* ----------
- * Paths for the statistics files (relative to installation's $PGDATA).
- * ----------
- */
-#define PGSTAT_STAT_PERMANENT_DIRECTORY "pg_stat"
-#define PGSTAT_STAT_PERMANENT_FILENAME "pg_stat/global.stat"
-#define PGSTAT_STAT_PERMANENT_TMPFILE "pg_stat/global.tmp"
-
-/* ----------
* Timer definitions.
* ----------
*/
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index d9de09fea0a..08925336d18 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -20,6 +20,14 @@
#include "utils/relcache.h"
+/* ----------
+ * Paths for the statistics files (relative to installation's $PGDATA).
+ * ----------
+ */
+#define PGSTAT_STAT_PERMANENT_DIRECTORY "pg_stat"
+#define PGSTAT_STAT_PERMANENT_FILENAME "pg_stat/global.stat"
+#define PGSTAT_STAT_PERMANENT_TMPFILE "pg_stat/global.tmp"
+
/* Default directory to store temporary statistics data in */
#define PG_STAT_TMP_DIR "pg_stat_tmp"