postgresql/src/backend/postmaster
Fujii Masao df9384492b Improve connection denied error message during recovery.
Previously when an archive recovery or a standby was starting and
reached the consistent recovery state but hot_standby was configured
to off, the error message when a client connectted was "the database
system is starting up", which was needless confusing and not really
all that accurate either.

This commit improves the connection denied error message during
recovery, as follows, so that the users immediately know that their
servers are configured to deny those connections.

- If hot_standby is disabled, the error message "the database system
  is not accepting connections" and the detail message "Hot standby
  mode is disabled." are output when clients connect while an archive
  recovery or a standby is running.

- If hot_standby is enabled, the error message "the database system
  is not yet accepting connections" and the detail message
  "Consistent recovery state has not been yet reached." are output
  when clients connect until the consistent recovery state is reached
  and postmaster starts accepting read only connections.

This commit doesn't change the connection denied error message of
"the database system is starting up" during normal server startup and
crash recovery. Because it's still suitable for those situations.

Author: James Coleman
Reviewed-by: Alvaro Herrera, Andres Freund, David Zhang, Tom Lane, Fujii Masao
Discussion: https://postgr.es/m/CAAaqYe8h5ES_B=F_zDT+Nj9XU7YEwNhKhHA2RE4CFhAQ93hfig@mail.gmail.com
2021-03-25 10:41:28 +09:00
..
autovacuum.c
bgworker.c
bgwriter.c
checkpointer.c Change checkpoint_completion_target default to 0.9 2021-03-24 13:07:51 -04:00
fork_process.c
interrupt.c
Makefile
pgarch.c Make archiver process an auxiliary process. 2021-03-15 13:13:14 +09:00
pgstat.c Rename wait event WalrcvExit to WalReceiverExit. 2021-03-24 10:37:54 +09:00
postmaster.c Improve connection denied error message during recovery. 2021-03-25 10:41:28 +09:00
startup.c Poll postmaster less frequently in recovery. 2021-03-12 19:45:42 +13:00
syslogger.c
walwriter.c Force to send remaining WAL stats to the stats collector at walwriter exit. 2021-03-12 13:29:59 +09:00