Re: Nicer error when connecting to standby with hot_standby=off

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: James Coleman <jtc331(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, David Steele <david(at)pgmasters(dot)net>, David Zhang <david(dot)zhang(at)highgo(dot)ca>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Nicer error when connecting to standby with hot_standby=off
Date: 2021-03-05 20:37:49
Message-ID: 20210305203749.GA12482@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021-Mar-05, James Coleman wrote:

> Do you have any thoughts on what you'd like to see the message be? I
> could change the PM_RECOVERY (without hot standby enabled) to return
> CAC_RECOVERY which would give us the message "the database system is
> in recovery mode", but that would be a change from what that state
> returns now in a way that's unrelated to the goal of the patch.

Here's an idea:

* hot_standby=on, before reaching consistent state
FATAL: database is not accepting connections
DETAIL: Consistent state has not yet been reached.

* hot_standby=off, past consistent state
FATAL: database is not accepting connections
DETAIL: Hot standby mode is disabled.

* hot_standby=off, before reaching consistent state
FATAL: database is not accepting connections
DETAIL: Hot standby mode is disabled.
or maybe
DETAIL: Consistent state has not yet been reached, and hot standby mode is disabled.

--
Álvaro Herrera 39°49'30"S 73°17'W
"Ed is the standard text editor."
http://groups.google.com/group/alt.religion.emacs/msg/8d94ddab6a9b0ad3

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-03-05 20:55:37 Re: CI/windows docker vs "am a service" autodetection on windows
Previous Message James Coleman 2021-03-05 20:04:50 Re: Nicer error when connecting to standby with hot_standby=off