You are providing the parameters in the wrong order.
From man fail2ban-regex:
fail2ban-regex [OPTIONS] <LOG> <REGEX> [IGNOREREGEX]
You must provide first the log file and then the configuration file, you are doing it the other way around.
The home directory of the user xzy is not readable by user postgres, but you start the psql command from there. As a result, you get *permission deny *. Change the directory to some other place before running the sudo:
sudo -u postgres psql
The short answer to this question unfortunately is that it is not possible to make it permanent update. However, I found a work-around and I hope this could be useful for anyone who develop from China.
Get a server running outside China. (For my case I used Vultr. It is as cheap as $5 / month.) You can use whatever convenient for you.
Install gcloud in that ...
PostgreSQL has a built-in autovavuum that should be enabled and configured to match your needs. Typically you adjust *autovacuum_vacuum_threshold * and autovacuum_analyze_threshold to kick off desired behavior based on the number of changed tuples.
It sounds like you have autovacuum disabled, which if it were enabled would analyze all of your tables periodically to update their statistics for the query planner.
The simplest solution is to re-enable autovacuum. Check your postgresql.conf file for the autovacuum setting.
Hardly an answer to my question, but I will document what I have found:
simply using \dt+ *.* to generate psql description of the entire database
https://www.schemacrawler.com/output.html generates diff friendly schema in plain text, HTML and JSON.
http://schemaspy.org/ - not what I was looking for, but discovered as a great way to document the current ...