SHOW SCHEMAS

On this page Carat arrow pointing down

The SHOW SCHEMAS statement lists all schemas in a database.

Required privileges

The CONNECT privilege on the database is required to list the schemas in a database.

Synopsis

SHOW SCHEMAS FROM name

Parameters

Parameter Description
name The name of the database for which to show schemas. When omitted, the schemas in the current database are listed.

Example

Setup

To follow along, run cockroach demo to start a temporary, in-memory cluster with the movr sample dataset preloaded:

icon/buttons/copy
$ cockroach demo

Show schemas in the current database

icon/buttons/copy
> CREATE SCHEMA org_one;
icon/buttons/copy
> SHOW SCHEMAS;
     schema_name
----------------------
  crdb_internal
  information_schema
  org_one
  pg_catalog
  pg_extension
  public
(6 rows)

See also


Yes No
On this page

Yes No