openGauss数据类型:列存表支持的数据类型

列存表支持的数据类型

列存表支持的数据类型如表17所示。

表 17 列存表支持的数据类型

类别

数据类型

长度

是否支持

Numeric Types

smallint

2

支持

integer

4

支持

bigint

8

支持

decimal

-1

支持

numeric

-1

支持

real

4

支持

double precision

8

支持

smallserial

2

支持

serial

4

支持

bigserial

8

支持

largeserial

-1

支持

Monetary Types

money

8

支持

Character Types

character varying(n), varchar(n)

-1

支持

character(n), char(n)

n

支持

character、char

1

支持

text

-1

支持

nvarchar2

-1

支持

name

64

不支持

Date/Time Types

timestamp with time zone

8

支持

timestamp without time zone

8

支持

date

4

支持

time without time zone

8

支持

time with time zone

12

支持

interval

16

支持

big object

clob

-1

支持

blob

-1

不支持

other types

不支持

XML类型

openGauss支持XML类型,使用示例如下。

openGauss= CREATE TABLE xmltest ( id int, data xml ); 
openGauss= INSERT INTO xmltest VALUES (1, 'one');
openGauss= INSERT INTO xmltest VALUES (2, 'two'); 
openGauss= SELECT * FROM xmltest ORDER BY 1;
 id | data 
----+--------------------
1 | one 
2 | two 
(2 rows)
openGauss= SELECT xmlconcat('', NULL, ''); 
xmlconcat
(1 row)
openGauss= SELECT xmlconcat('', NULL, ''); 
xmlconcat
(1 row)

 说明:

  • 该功能默认未开启,如需使用,需要重新使用build.sh脚本编译数据库,修改./configure配置参数,在其中加入--with-libxml参数。
  • 在执行编译之前,需要先执行yum install -y libxml2-devel,否则会有"configure: error: library 'xml2' (version >= 2.6.23) is required for XML support"的报错。
  • 在执行编译之前,需要三方库二进制文件中dependency操作系统环境/libobs/comm/lib加入到系统环境变量LD_LIBRARY_PATH中,否则会报错"libiconv.so不存在"。
posted @ 2024-05-27 18:48  openGauss-bot  阅读(57)  评论(0)    收藏  举报