Integer Types
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
There are several different datatypes for integers of different value ranges. Integers can be set, inserted, incremented, and decremented.
DataType | Min | Max |
---|---|---|
SMALLINT | -32,768 | 32,767 |
INT or INTEGER | -2,147,483,648 | 2,147,483,647 |
BIGINT | -9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 |
Syntax
The following keywords are used to specify a column of type integer for different constraints including its value ranges.
type_specification ::= SMALLINT | INT | INTEGER | BIGINT
integer_literal ::= [ + | - ] digit [ { digit | , } ... ]
Semantics
- Columns of type
SMALLINT
,INT
,INTEGER
, orBIGINT
can be part of thePRIMARY KEY
. - Values of different integer datatypes are comparable and convertible to one another.
- Values of integer datatypes are convertible but not comparable to floating point number.
- Currently, values of floating point datatypes are not convertible to integers. This restrictionwill be removed in the near future.
See Also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .