Skip to content

Commit 13ea43a

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 a5363a6 commit 13ea43a

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
@@ -4650,7 +4650,7 @@ pgstat_recv_dropdb(PgStat_MsgDropdb *msg, int len)
46504650
{
46514651
char statfile[MAXPGPATH];
46524652

4653-
get_dbstat_filename(true, false, dbid, statfile, MAXPGPATH);
4653+
get_dbstat_filename(false, false, dbid, statfile, MAXPGPATH);
46544654

46554655
elog(DEBUG2, "removing %s", statfile);
46564656
unlink(statfile);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy