All Products
Search
Document Center

PolarDB:Data types

Last Updated:Jul 29, 2024

This topic describes the data types supported by PolarDB-X.

Numeric data types

PolarDB-X supports exact numeric data and approximate numeric data.

  • Exact numeric data includes integer data and fixed-point data.

    • Integer data types: TINYINT, SMALLINT, MEDIUMINT, INTEGER, and BIGINT.

    • Fixed-point data types: DECIMAL and NUMERIC

  • Approximate numeric data types: FLOAT, REAL, DOUBLE, and PRECISION

The numeric data types supported by PolarDB-X are the same as those supported by MySQL. For more information, see Numeric Data Types.

String data types

PolarDB-X supports the following string data types:

  • CHAR and VARCHAR

  • BINARY and VARBINARY

  • BLOB and TEXT

  • ENUM

  • SET

For more information, see String Data Types.

Collation types

A character set is a combination of a set of symbols and encoding methods. A collation is the group of rules for sorting characters in a character set.

The following table shows the collation types supported by PolarDB-X. For more information about the collation types, see Character Sets and Collations in General.

Character set

collation

utf8

utf8_general_ci

utf8_bin

utf8_unicode_ci

utf8mb4

utf8mb4_general_ci

utf8mb4_bin

utf8mb4_unicode_ci

utf16

utf16_general_ci

utf16_bin

utf16_unicode_ci

ascii

ascii_general_ci

ascii_bin

binary

binary

latin1

latin1_swedish_ci

latin1_german1_ci

latin1_danish_ci

latin1_bin

latin1_general_ci

latin1_general_cs

latin1_spanish_ci

gbk

gbk_chinese_ci

gbk_bin

Date and time data types

PolarDB-X supports the following date and time data types:

  • DATE

  • DATETIME

  • TIMESTAMP

  • TIME

  • YEAR

For more information, see Date and Time Data Types.

JSON type

PolarDB-X supports JSON data.

However, JSON data cannot be specified as partition keys in PolarDB-X.

For more information, see The JSON Data Type.