mirror of
https://github.com/postgres/postgres.git
synced 2025-12-06 00:02:13 +03:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user