Project: ClickHouse (App Definition and Development / Database)
File: columns.md

slug: /en/operations/system-tables/columns Contains information about columns in all the tables. You can use this table to get information similar to the query, but for multiple tables at once. Columns from are visible in the `system.columns` only in those session where they have been created. They are shown with the empty `database` field. The `system.columns` table contains the following columns (the column type is shown in brackets): `database` () Database name. `table` () Table name. `name` () Column name. `type` () Column type. `position` () Ordinal position of a column in a table starting with 1. `default_kind` () Expression type (`DEFAULT`, `MATERIALIZED`, `ALIAS`) for the default value, or an empty string if it is not defined. `default_expression` () Expression for the default value, or an empty string if it is not defined. `datacompressedbytes` () The size of compressed data, in bytes. `datauncompressedbytes` () The size of decompressed data, in bytes. `marks_bytes` () The size of marks, in bytes. `comment` () Comment on the column, or an empty string if it is not defined. `isinpartition_key` () Flag that indicates whether the column is in the partition expression. `isinsorting_key` () Flag that indicates whether the column is in the sorting key expression. `isinprimary_key` () Flag that indicates whether the column is in the primary key expression. `isinsampling_key` () Flag that indicates whether the column is in the sampling key expression. `compression_codec` () Compression codec name. `characteroctetlength` (()) Maximum length in bytes for binary data, character data, or text data and images. In ClickHouse makes sense only for `FixedString` data type. Otherwise, the `NULL` value is returned. `numeric_precision` (()) Accuracy of approximate numeric data, exact numeric data, integer data, or monetary data. In ClickHouse it is bit width for integer types and decimal precision for `Decimal` types. Otherwise, the `NULL` value is returned. `numericprecisionradix` (()) The base of the number system is the accuracy of approximate numeric data, exact numeric data, integer data or monetary data. In ClickHouse it's 2 for integer types and 10 for `Decimal` types. Otherwise, the `NULL` value is returned. `numeric_scale` (()) The scale of approximate numeric data, exact numeric data, integer data, or monetary data. In ClickHouse makes sense only for `Decimal` types. Otherwise, the `NULL` value is returned. `datetime_precision` (()) Decimal precision of `DateTime64` data type. For other data types, the `NULL` value is returned. Example ```sql SELECT * FROM system.columns LIMIT 2 FORMAT Vertical; ``` ```text Row 1: database: INFORMATION_SCHEMA table: COLUMNS name: table_catalog type: String position: 1 default_kind: default_expression: datacompressedbytes: 0 datauncompressedbytes: 0 marks_bytes: 0 comment: isinpartition_key: 0 isinsorting_key: 0 isinprimary_key: 0 isinsampling_key: 0 compression_codec: characteroctetlength: numeric_precision: numericprecisionradix: numeric_scale: datetime_precision: Row 2: database: INFORMATION_SCHEMA table: COLUMNS name: table_schema type: String position: 2 default_kind: default_expression: datacompressedbytes: 0 datauncompressedbytes: 0 marks_bytes: 0 comment: isinpartition_key: 0 isinsorting_key: 0 isinprimary_key: 0 isinsampling_key: 0 compression_codec: characteroctetlength: numeric_precision: numericprecisionradix: numeric_scale: datetime_precision: ```