From 5d92c99bb9c5eefed4d28377aa0c052bf925d23c Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 26 Mar 2020 11:18:04 +0900 Subject: [PATCH] standby switchover: warn if no superuser connection available --- repmgr-action-standby.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 3b4cfd42..6b95cea0 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -3561,6 +3561,16 @@ do_standby_switchover(void) } } + /* + * Warn if no superuser connection is available. + */ + if (superuser_conn == NULL && is_superuser_connection(local_conn, NULL) == false) + { + log_warning(_("no superuser connection available")); + log_detail(_("it is recommended to perform switchover operations with a database superuser")); + log_hint(_("provide the name of a superuser with -S/--superuser")); + } + /* Check that this is a standby */ recovery_type = get_recovery_type(local_conn); if (recovery_type != RECTYPE_STANDBY)