Skip to main content

SHOW

The SHOW statement inspects the database — it lists tables, databases and schemas, shows the schema of a relation and displays the values of session variables.

SHOW

SHOW is an alias for DESCRIBE: given a table, view or query it returns that relation's columns and their types.

SHOW TABLES

SHOW TABLES lists the tables in the current database and schema:

Query
SHOW TABLES;
Result
 name---------- products

Use SHOW TABLES FROM <database> to list the tables of another attached database.

SHOW DATABASES

SHOW DATABASES lists every attached database. This includes SereneDB's internal catalogs — the transactional store (__sdb_store) and the default in-memory database (memory) — alongside your own databases:

Query
SHOW DATABASES;

SHOW SCHEMAS

SHOW SCHEMAS lists the schemas of every attached database, internal catalogs included:

Query
SHOW SCHEMAS;

Each row pairs a database with one of its schemas; the current column marks the default schema, set via the USE statement.

Session variables

SHOW <variable> displays the current value of a session variable:

Query
SHOW search_path;
Result
 search_path----------------- "$user", public

SHOW ALL displays every variable with its value and description:

Query
SHOW ALL;
DETACH IF EXISTS db81;

See also

  • DESCRIBESHOW is an alias for it
  • SET — change a session variable