List offending databases in pg_upgrade datallowconn check
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Thu, 24 Mar 2022 21:41:40 +0000 (22:41 +0100)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Thu, 24 Mar 2022 21:41:40 +0000 (22:41 +0100)
commit26ebb0e28032283f99bf985fb47ea3d19fbaf91a
tree2b801619fef8d61ae3f6e1d5bebd4a71bb60ef77
parentce95c543763b6fade641a67fa0c70649d8527243
List offending databases in pg_upgrade datallowconn check

The check for datallowconn being properly set on all databases in the
old cluster errored out on the first instance, rather than report the
set of problematic databases.  This adds reporting to a textfile like
how many other checks are performed.  While there, also add a comment
to the function as per how other checks are commented.

This check won't catch if template1 isn't allowing connections, since
that's used for connecting in the first place.  That error remains as
it is today:

connection to server on socket ".." failed: FATAL:  database "template1" is not currently accepting connections

Author: Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>
Reviewed-by: Suraj Kharage <suraj.kharage@enterprisedb.com>
Reviewed-by: Justin Pryzby <pryzby@telsasoft.com>
Discussion: https://postgr.es/m/CAOgcT0McABqF_iFFQuuRf9is+gmYMsmUu_SWNikyr=2VGyP9Jw@mail.gmail.com
src/bin/pg_upgrade/check.c