SHOW Statement
The SHOW statement can also show the schema of a table, view or query, like DESCRIBE. As of DuckDB 2.0, this usage is deprecated and prints a warning; use DESCRIBE instead.
New The following feature was introduced in DuckDB 2.0.
SHOW can also print a configuration setting when the name is not a table (PostgreSQL-style):
SET threads = 42;
SHOW threads;
| threads |
|---|
| 42 |
If both a table and a setting share the name, SHOW describes the table and prints a deprecation warning (use DESCRIBE for tables). DESCRIBE never resolves a setting.
The show_behavior setting configures how SHOW resolves a bare identifier:
'auto'(default): describe a table if one exists, otherwise show the setting.'table': always describe a table.'setting': always show a setting.
SET show_behavior = 'setting';
SHOW DATABASES Statement
The SHOW DATABASES statement shows a list of all attached databases:
ATTACH 'my.duckdb' AS my_database;
SHOW DATABASES;
| database_name |
|---|
| memory |
| my_database |
DETACH my_database;
SHOW DATABASES;
| database_name |
|---|
| memory |
SHOW SCHEMAS Statement
This statement was introduced in DuckDB 1.5.
The SHOW SCHEMAS statement shows a list of all schemas across non-internal databases:
SHOW SCHEMAS;
| database_name | schema_name | current |
|---|---|---|
| memory | main | true |
The current column indicates which schema is the default schema (set via the USE statement).