If you do the following sequence, the server gives the least helpful error message:
----
initdb data
pg_ctl -D data -l logfile start
# The following reconfigs are obvious based on error message if you try to take a base backup
echo 'local replication all trust’ >> data/pg_hba.conf
sed -i 's/#wal_level = minimal/wal_level = hot_standby/' data/postgresql.conf
sed -i 's/#max_wal_senders = 0/max_wal_senders = 5/' data/postgresql.conf
# Backup and start
pg_basebackup -D data_5434 -R
pg_ctl -D data_5434 -l logfile_5434 -o ‘-p 5434’ start
# Attempt psql
psql -p 5434
> psql: FATAL: the database system is starting up
----
It doesn’t matter what log level you put the server log in either, it providers no additional helpful information.
The problem of course is that:
postgresql.conf: hot_standby = ‘off'
recovery.conf: standby = ‘on'
Why anybody in practice would want hot_standby off while in standby mode eludes me, but these are our default values (recovery.conf was generated by pg_basebackup -R).
It seems worth adding a hint and/or changing the error message to be more descriptive when in this state. Any options about what should be logged before I start putting together a patch?
- Matt K