We have Installed fresh gpdb database.But,when trying to connect with template0 database.
[gpadmin@mdw~]$ psql -d template0
psql: FATAL: database "template0" is not currently accepting connections
[gpadmin@mdw~]$
We tried to Update the FLAG
template1=# UPDATE pg_database SET datallowconn = TRUE WHERE datname = 'template0';
ERROR: permission denied: "pg_database" is a system catalog
template1=#
But,it is not allowing to Update The FLAG
There is no reason to connect to template0. Even template1 should not be used, because that is the default template for newly created databases. If you create something in template1, it will be copied into any new database. That is easy to forget if you use template1 to connect to the database and then forget to switch databases.
You can use the postgres database for connections. That one is not used otherwise.