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 Rename an S3 bucket