aboutsummaryrefslogtreecommitdiff
path: root/src/backend/postmaster/pgstat.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2014-03-18 07:58:53 -0400
committerRobert Haas <rhaas@postgresql.org>2014-03-18 07:58:53 -0400
commit79a4d24f31e09eb3c421deb34829eee0bf6acd67 (patch)
tree8b0bba2d25d63961f2c4ac287034347372d6e7de /src/backend/postmaster/pgstat.c
parent551fb5ac742eb7dbf92aa80743aa5a52b8a0189f (diff)
downloadpostgresql-79a4d24f31e09eb3c421deb34829eee0bf6acd67.tar.gz
postgresql-79a4d24f31e09eb3c421deb34829eee0bf6acd67.zip
Make it easy to detach completely from shared memory.
The new function dsm_detach_all() can be used either by postmaster children that don't wish to take any risk of accidentally corrupting shared memory; or by forked children of regular backends with the same need. This patch also updates the postmaster children that already do PGSharedMemoryDetach() to do dsm_detach_all() as well. Per discussion with Tom Lane.
Diffstat (limited to 'src/backend/postmaster/pgstat.c')
-rw-r--r--src/backend/postmaster/pgstat.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 1ca5d130444..3dc280a48d7 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -50,6 +50,7 @@
#include "postmaster/postmaster.h"
#include "storage/proc.h"
#include "storage/backendid.h"
+#include "storage/dsm.h"
#include "storage/fd.h"
#include "storage/ipc.h"
#include "storage/latch.h"
@@ -709,6 +710,7 @@ pgstat_start(void)
on_exit_reset();
/* Drop our connection to postmaster's shared memory, as well */
+ dsm_detach_all();
PGSharedMemoryDetach();
PgstatCollectorMain(0, NULL);