"Richard Wang" <ruc_wang@hotmail.com> writes:
> I just consider this may happens and pg can't recover correctly:
> if postgres crashed last time and left a postmaster.pid file, and last
> postgres
> id is reused by another process which is not postgres now.
Postgres defends itself against that just fine, at least in any
reasonably recent release. There are some corner cases where it
could have problems, but scripted hacking on the .pid file is just
about guaranteed to make things worse not better.
regards, tom lane