SHOW COLUMNS shows details about columns in a table, including each column’s name, type, default value, and whether or not it’s nullable.
Required privileges
The user must have any on the target table.Synopsis
Parameters
| Parameter | Description |
|---|---|
table_name | The name of the table for which to show columns. |
Response
The following fields are returned for each column.| Field | Description |
|---|---|
column_name | The name of the column. |
data_type | The of the column. |
is_nullable | Whether or not the column accepts NULL. Possible values: true or false. |
column_default | The default value for the column, or an expression that evaluates to a default value. |
generation_expression | The expression used for a . |
indices | The list of that the column is involved in, as an array. |
is_hidden | Whether or not the column is hidden. Possible values: true or false. |
Examples
Setup
The following examples use MovR, a fictional vehicle-sharing application, to demonstrate CockroachDB SQL statements. For more information about the MovR example application and dataset, see . To follow along, run to start a temporary, in-memory cluster with themovr dataset preloaded:
Show columns in a table
\d :

