SHOW COLUMNS

SHOW COLUMNS lists the columns available for an object. This can be a source, subsource, materialized view, view, or table.

Syntax

SHOW COLUMNS FROM <object_name>
[LIKE <pattern> | WHERE <condition(s)>]
Option Description
LIKE <pattern> If specified, only show columns that match the pattern.
WHERE <condition(s)> If specified, only show columns that match the condition(s).

Details

Output format

SHOW COLUMNS’s output is a table, with this structure:

+---------+------------+--------+
| name    | nullable   | type   |
|---------+------------+--------|
| ...     | ...        | ...    |
+---------+------------+--------+
Field Meaning
name The name of the column
nullable Does the column accept null values?
type The column’s type

Rows are sorted by the order in which the fields are defined in the targeted object.

Examples

SHOW SOURCES;
   name
----------
my_sources
SHOW COLUMNS FROM my_source;
  name  | nullable | type
---------+----------+------
 column1 | f       | int4
 column2 | f       | text

Privileges

The privileges required to execute this statement are:

  • USAGE privileges on the schema containing item_ref.
Back to top ↑