Обсуждение: Re: postmaster.pid

Поиск
Список
Период
Сортировка

Re: postmaster.pid

От
"Magnus Hagander"
Дата:
> > I think it's better to call uor named pipe. That way we'll
> find out if
> > it's actually a postmaster of ours or a different process
> alltogether
> > there.
>
> I'm not sure that's a good idea. The function is there to
> emulate the unix kill() which doesn't care what the process
> is. Changing the code as you suggest could cause confusionon
> Windows if someone uses kill() for other purposes.

Why would they link with libpgport if they use it for other purposes?
;-)

But sure, we don't really care if it's a postmaster. Then OpenProcess()
is probably the best way, yes.

//Magnus

Re: postmaster.pid

От
Tom Lane
Дата:
"Magnus Hagander" <mha@sollentuna.net> writes:
> But sure, we don't really care if it's a postmaster. Then OpenProcess()
> is probably the best way, yes.

Au contraire!!  One of the problems with the Unix implementation is that
you *can't* tell for sure if the target process is a postmaster.  See
past discussions about how startup occasionally fails because we get
fooled by the PID mentioned in postmaster.pid now belonging to pg_ctl or
some other Postgres-owned process.

This is a place where the Windows version can actually be better than
the Unix one.  Please fix it and stop imagining that your charter is to
duplicate a particular Unix syscall bug-for-bug.

            regards, tom lane