Skip to content

Commit 2b4f2ab

Browse files
committed
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 187492b. 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
1 parent 65b9671 commit 2b4f2ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4772,7 +4772,7 @@ pgstat_recv_dropdb(PgStat_MsgDropdb *msg, int len)
47724772
{
47734773
char statfile[MAXPGPATH];
47744774

4775-
get_dbstat_filename(true, false, dbid, statfile, MAXPGPATH);
4775+
get_dbstat_filename(false, false, dbid, statfile, MAXPGPATH);
47764776

47774777
elog(DEBUG2, "removing %s", statfile);
47784778
unlink(statfile);

0 commit comments

Comments
 (0)