The SHOW DATABASES statement lists all databases in the CockroachDB cluster.
Synopsis
Required privileges
No privileges are required to list the databases in the CockroachDB cluster.
Example
> SHOW DATABASES;
+---------------+
| database_name |
+---------------+
| defaultdb     |
| postgres      |
| system        |
+---------------+
(3 rows)
Default databases
New clusters and existing clusters upgraded to v2.1 will include three auto-generated databases, with the following purposes:
- The empty - defaultdbdatabase is used if a client does not specify a database in the connection parameters.
- An empty database called - postgresis provided for compatibility with Postgres client applications that require it.
- The - systemdatabase contains CockroachDB metadata and is read-only.
The postgres and defaultdb databases can be deleted if they are not needed.