From 2b4f2ab33dea09e47b93a2eb4be05aa4d40b49ee Mon Sep 17 00:00:00 2001 From: Alvaro Herrera <alvherre@alvh.no-ip.org> Date: Wed, 5 Mar 2014 13:03:29 -0300 Subject: [PATCH] Remove the correct pgstat file on DROP DATABASE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/backend/postmaster/pgstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- GitLab