Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 1.63 KB

File metadata and controls

32 lines (21 loc) · 1.63 KB
title Data Types
summary Learn about the data types supported in TiDB.

Data Types

TiDB supports all the data types in MySQL except the SPATIAL type. This includes all the numeric types, string types, date & time types, and the JSON type.

The definitions used for datatypes are specified as T(M[, D]). Where by:

  • T indicates the specific data type.
  • M indicates the maximum display width for integer types. For floating-point and fixed-point types, M is the total number of digits that can be stored (the precision). For string types, M is the maximum length. The maximum permissible value of M depends on the data type.

Warning:

Starting from v8.5.0, integer display width is deprecated (deprecate-integer-display-length is true by default). Specifying display width for integer types is NOT recommended.

Warning:

Starting from v8.5.0, integer display width is deprecated. Specifying display width for integer types is NOT recommended.

  • D applies to floating-point and fixed-point types and indicates the number of digits following the decimal point (the scale).
  • fsp applies to the TIME, DATETIME, and TIMESTAMP types and represents the fractional seconds precision. The fsp value, if given, must be in the range 0 to 6. A value of 0 signifies that there is no fractional part. If omitted, the default precision is 0.