Re: FATAL: bogus data in lock file "postmaster.pid": ""

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Michael Beattie <mtbeedee@gmail.com>, Magnus Hagander <magnus@hagander.net>, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2012-08-27T20:29:46Z
Lists: pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> I have developed the attached patch to report a zero-length file, as you
> suggested.

DIRECTORY_LOCK_FILE is entirely incorrect there.

Taking a step back, I don't think this message is much better than the
existing behavior of reporting "bogus data".  Either way, it's not
obvious to typical users what the problem is or what to do about it.
If we're going to emit a special message I think it should be more user
friendly than this.

Perhaps something like:

	FATAL: lock file "foo" is empty
	HINT: This may mean that another postmaster was starting at the
	same time.  If not, remove the lock file and try again.

			regards, tom lane