Updated on 2025-10-23 GMT+08:00

columns

The columns view provides information about columns in tables. The related st_geometry_columns table provides information about table columns that store spatial data. This view is read-only. All users have the read permission on this view.

Table 1 information_schema.columns columns

Name

Type

Description

TABLE_CATALOG

varchar(512)

Name of the catalog (database) to which the table containing the column belongs. The value is the name of the current database. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

TABLE_SCHEMA

varchar(64)

Name of the schema to which the table containing the column belongs. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

TABLE_NAME

varchar(64)

Name of the table containing the column. When lower_case_table_names is set to 0, the value of this column is case-sensitive. When lower_case_table_names is set to 1, the value of this column is case-insensitive.

COLUMN_NAME

varchar(64)

Name of the column.

ORDINAL_POSITION

bigint unsigned

Position of the column within the table.

COLUMN_DEFAULT

longtext

Default value of the column.

IS_NULLABLE

varchar(3)

Nullability of the column.

DATA_TYPE

varchar(64)

Data type of the column.

CHARACTER_MAXIMUM_LENGTH

bigint unsigned

Maximum length of string columns, in characters.

CHARACTER_OCTET_LENGTH

bigint unsigned

Maximum length of string columns, in bytes.

NUMERIC_PRECISION

bigint unsigned

Precision of numeric columns.

NUMERIC_SCALE

bigint unsigned

Scale of numeric columns.

DATETIME_PRECISION

bigint unsigned

Precision of fractional seconds in temporal columns.

CHARACTER_SET_NAME

varchar(32)

Character set name for string columns.

COLLATION_NAME

varchar(32)

Collation rule name for string columns.

COLUMN_TYPE

longtext

Data type of the column. The value of column_type contains the type name and possibly other information, such as the precision or length.

COLUMN_KEY

varchar(3)

Specifies whether the column is indexed.

  • pri: The column is a primary key or is one of the columns in a multiple-column primary key.
  • uni: The column is the first column of a unique index.
  • mul: The column is the first column of a non-unique index.
  • Empty: The column is not indexed or is not pri, uni, or mul.

EXTRA

varchar(30)

Any other available information about the specified column. The value is not NULL in the following cases:

  • auto_increment: columns with the AUTO_INCREMENT attribute.
  • on update CURRENT_TIMESTAMP: columns with the on update CURRENT_TIMESTAMP attribute for time columns.
  • STORED GENERATED: columns with the STORED GENERATED attribute for generated columns.
  • VIRTUAL GENERATED: columns with the VIRTUAL GENERATED attribute for generated columns.

PRIVILEGES

varchar(80)

Permission the current user has on the column.

COLUMN_COMMENT

varchar(1024)

Any comment included in the column definition.

GENERATION_EXPRESSION

longtext

For a generated column, this column displays the expression used to compute the column value. For a non-generated column, this column is empty.

If m_format_dev_version is not s2, the query result will include the temporary tables created in the current session but exclude those created in other sessions. If m_format_dev_version is s2, the query result will exclude both the temporary tables created in other sessions and those created in the current session.