How to list all the databases in a Redshift cluster

Run the below query to list all the databases in a Redshift cluster.

select oid as db_id, datname as db_name, datallowconn from pg_database;

See also  How to disable AWS Management Console access for IAM user