[This is meant to be a follow-up of a bug report I sent earlier using the web
form. It's not clear to me the right way to post a follow-up, since I didn't
get a copy of the email generated by the web form, and the email hasn't shown
up on the pgsql-bugs web site -- at least not yet.]
I subsequently discovered that setting PGUSER in the environment gets around
the first problem I mentioned, so it's really just a documentation problem:
PGUSER is not mentioned on the pg_ctl doc page.
But I found a worse problem. Sometimes (not repeatably), pg_ctl start -w
logs the message
FATAL: the database is starting up
and immediately returns. I believe the correct thing for it to do when it
gets this message from an attempt to open a session is to try again. Instead,
it returns as if the startup was successful.