附录1:各种数据库支持的数据类型
注:以下为各数据库支持的数据类型,出现在表中的类型代表均支持单值,数组(ARRAY)和区间(INTERVAL)用“✓”和“✗”代表是否支持
Postgres/Greenplum/Gaussdb
数据类型 | 是否支持单值 | 是否支持 ARRAY | 是否支持 INTERVAL | 备注 |
---|---|---|---|---|
text | ✓ | ✓ | ✗ | |
character varying | ✓ | ✓ | ✗ | varchar |
character | ✓ | ✓ | ✗ | bpchar |
timestamp with time zone | ✓ | ✓ | ✗ | timestamptz |
timestamp without time zone | ✓ | ✓ | ✗ | timestamp |
uuid | ✓ | ✓ | ✗ | |
real | ✓ | ✓ | ✗ | float4 |
double precision | ✓ | ✓ | ✗ | float8 |
smallint | ✓ | ✓ | ✗ | int2 |
date | ✓ | ✓ | ✗ | |
money | ✓ | ✓ | ✗ | |
integer | ✓ | ✓ | ✗ | int4 |
macaddr | ✓ | ✓ | ✗ | |
macaddr8 | ✓ | ✓ | ✗ | |
numeric | ✓ | ✓ | ✗ | |
bigint | ✓ | ✓ | ✗ | int8 |
cidr | ✓ | ✓ | ✗ |
查询属性类型的sql语句: select data_type from information_schema."columns" c where table_name = ''
MySQL
数据类型 | 是否支持单值 | 是否支持 ARRAY | 是否支持 INTERVAL |
---|---|---|---|
int | ✓ | ✗ | ✗ |
tinyint | ✓ | ✗ | ✗ |
smallint | ✓ | ✗ | ✗ |
mediumint | ✓ | ✗ | ✗ |
bigint | ✓ | ✗ | ✗ |
float | ✓ | ✗ | ✗ |
double | ✓ | ✗ | ✗ |
decimal | ✓ | ✗ | ✗ |
char | ✓ | ✗ | ✗ |
varchar | ✓ | ✗ | ✗ |
text | ✓ | ✗ | ✗ |
tinytext | ✓ | ✗ | ✗ |
longtext | ✓ | ✗ | ✗ |
mediumtext | ✓ | ✗ | ✗ |
year | ✓ | ✗ | ✗ |
date | ✓ | ✗ | ✗ |
datetime | ✓ | ✗ | ✗ |
timestamp | ✓ | ✗ | ✗ |
查询属性类型的sql语句: select COLUMN_NAME, DATA_TYPE from information_schema.columns where table_schema = '' and table_name = ''
Oracle
数据类型 | 是否支持单值 | 是否支持 ARRAY | 是否支持 INTERVAL | 备注 |
---|---|---|---|---|
INTERGER | ✓ | ✗ | ✗ | |
SMALLINT | ✓ | ✗ | ✗ | |
LONG | ✓ | ✗ | ✗ | |
NUMBER | ✓ | ✗ | ✗ | |
FLOAT | ✓ | ✗ | ✗ | |
CHAR | ✓ | ✗ | ✗ | |
NCHAR | ✓ | ✗ | ✗ | |
VARCHAR | ✓ | ✗ | ✗ | |
NVARCHAR | ✓ | ✗ | ✗ | |
VARCHAR2 | ✓ | ✗ | ✗ | |
NVARCHAR2 | ✓ | ✗ | ✗ | |
DATE | ✓ | ✗ | ✗ | |
TIMESTAMP(6) | ✓ | ✗ | ✗ | 默认的timestamp类型 |
查询属性类型的sql语句:SELECT COLUMN_NAME, DATA_TYPE FROM all_tab_columns WHERE OWNER = '' AND TABLE_NAME = ''
Hive
数据类型 | 是否支持单值 | 是否支持 ARRAY | 是否支持 INTERVAL |
---|---|---|---|
int | ✓ | ✓ | ✗ |
tinyint | ✓ | ✓ | ✗ |
smallint | ✓ | ✓ | ✗ |
bigint | ✓ | ✓ | ✗ |
float | ✓ | ✓ | ✗ |
double | ✓ | ✓ | ✗ |
decimal | ✓ | ✓ | ✗ |
char | ✓ | ✓ | ✗ |
string | ✓ | ✓ | ✗ |
varchar | ✓ | ✓ | ✗ |
date | ✓ | ✓ | ✗ |
timestamp | ✓ | ✓ | ✗ |
查询属性类型的sql语句: desc ``.`` (此处是反引号)