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 allocate a new Elastic IP and associate it to an EC2 Instance