LIST SCHEMAS

Syntax

{ LIST | SHOW } SCHEMAS
    [IN DATABASE database_name];

Description

This provides a list of Schemas in the current Database or in a specific database. Only Schemas with ownership are returned in the list.

Schemas will only be listed if the current role has USAGE privileges on the Database and Schema.

Arguments

IN DATABASE database_name

Optionally, this lists the schemas in the provided database.

Examples

List Schemas in the current Database

The following provides a list of Schemas in the current demodb Database:

demodb.public/demostore# LIST SCHEMAS;
    Name    | Default |  Owner   |      Created at      |      Updated at       
------------+---------+----------+----------------------+-----------------------
  analytics |        | sysadmin | 2023-01-11T19:59:26Z | 2023-02-14T22:46:52Z  
  public    |         | sysadmin | 2023-01-11T19:59:26Z | 2023-02-14T22:46:52Z  
  ml        |         | sysadmin | 2023-01-11T19:59:26Z | 2023-02-14T22:46:52Z  

List Schemas in a specific Database

The following provides a list of Schemas in the anotherdb Database:

demodb.public/demostore# LIST SCHEMAS IN DATABASE anotherdb;
   Name  | Default |  Owner   |      Created at      |      Updated at       
---------+---------+----------+----------------------+-----------------------
  public |        | sysadmin | 2023-02-14T20:06:55Z | 2023-02-14T20:06:55Z  

Last updated