On 2018-03-07 23:34:37 -0500, Tom Lane wrote:
> Craig Ringer <craig@2ndquadrant.com> writes:
> > As I understand it, because we allow multiple Pg instances on a system, we
> > identify the small sysv shmem segment we use by the postmaster's pid. If
> > you remove the DirLockFile (postmaster.pid) you remove the interlock
> > against starting a new postmaster. It'll think it's a new independent
> > instance on the same host, make a new shmem segment and go merrily on its
> > way mangling data horribly.
>
> Yeah. If we realized that the old shmem segment was associated with this
> data directory, we could check for processes still attached to it ... but
> the lock file is exactly where that association is kept.
I'd somehow remembered that we just took the path as the identifier, but
that's wrong...
Greetings,
Andres Freund