Lists every non-template database in your Redshift cluster so you can confirm names, owners, and encodings.
Run SHOW DATABASES;
in any SQL client connected to your Redshift cluster. The command returns every database name, its owner, and ACLs in milliseconds.
Inside the psql
shell, type \l
or \list
. Redshift treats the backslash meta-command the same as PostgreSQL and prints the databases in a formatted table.
Yes. Use a catalog query:
SELECT datname
FROM pg_database
WHERE datistemplate = false AND datname NOT IN ('rdsadmin');
SHOW DATABASES
returns database_name
, owner
, and acl
. The pg_database
catalog supplies extra columns such as encoding
, datcollate
, and datctype
.
Query the catalog when you need filters, ordering, or additional metadata (size, encoding, creation date). SHOW DATABASES
is best for a quick, unfiltered list.
Use SHOW DATABASES
in scripts for portability; fall back to pg_database
when you need advanced filtering. Always exclude template0
, template1
, and rdsadmin
from user-facing lists.
No. INFORMATION_SCHEMA views are schema-scoped. Use pg_database or SHOW DATABASES for cluster-wide lists.
Yes. Join pg_database
with SVV_DATABASE_INFO
to get size in MB.