Skip to main content
The 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

show_columns syntax diagram

Parameters

Response

The following fields are returned for each column.

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 the movr dataset preloaded:

Show columns in a table

Alternatively, within the built-in SQL shell, you can use the \d :

Show columns with comments

You can use to add comments on a column.

See also