aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2014-03-05 13:03:29 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2014-03-05 13:03:29 -0300
commit2b4f2ab33dea09e47b93a2eb4be05aa4d40b49ee (patch)
treece9a9b6134a8b49b49fe16d7420a9f692c4660c5
parent65b96714118d3919195d2dd47e8d2df23718c7ab (diff)
downloadpostgresql-2b4f2ab33dea09e47b93a2eb4be05aa4d40b49ee.tar.gz
postgresql-2b4f2ab33dea09e47b93a2eb4be05aa4d40b49ee.zip
Remove the correct pgstat file on DROP DATABASE
We were unlinking the permanent file, not the non-permanent one. But since the stat collector already unlinks all permanent files on startup, there was nothing for it to unlink. The non-permanent file remained in place, and was copied to the permanent directory on shutdown, so in effect no file was ever dropped. Backpatch to 9.3, where the issue was introduced by commit 187492b6c2e8. Before that, there were no per-database files and thus no file to drop on DROP DATABASE. Per report from Thom Brown. Author: Tomáš Vondra
-rw-r--r--src/backend/postmaster/pgstat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 06ea5880859..1ca5d130444 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -4772,7 +4772,7 @@ pgstat_recv_dropdb(PgStat_MsgDropdb *msg, int len)
{
char statfile[MAXPGPATH];
- get_dbstat_filename(true, false, dbid, statfile, MAXPGPATH);
+ get_dbstat_filename(false, false, dbid, statfile, MAXPGPATH);
elog(DEBUG2, "removing %s", statfile);
unlink(statfile);