Skip to main content
The SHOW DATABASES lists all databases in the CockroachDB cluster.

Synopsis

show_databases syntax diagram

Required privileges

The user must be granted the CONNECT to specific databases in order to list those databases in the CockroachDB cluster.

Example

Show databases

Alternatively, within the built-in SQL shell, you can use the \l to list all databases:

Show databases with comments

You can use to add comments on a database.
To view a database’s comments:
For more information, see .

Preloaded databases

New clusters and existing clusters to v25.1 or later will include auto-generated databases, with the following purposes:
  • The empty defaultdb database is used if a client does not specify a database in the .
  • The movr database contains data about users, vehicles, and rides for the vehicle-sharing app (only when the cluster is started using the ).
  • The empty postgres database is provided for compatibility with PostgreSQL client applications that require it.
  • The system database contains CockroachDB metadata and is read-only.
All databases except for the system database can be if they are not needed.
Do not query the system database directly. Instead, use objects within the .

See also