XML类型

XML类型 - 图1 说明: 轻量版场景下,openGauss默认不支持XML类型。

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

1. openGauss= CREATE TABLE xmltest (id int, data xml);
2. openGauss= INSERT INTO xmltest VALUES (1, '<value>one</value>');
3. openGauss= INSERT INTO xmltest VALUES (2, '<value>two</value>');
4. openGauss= SELECT * FROM xmltest ORDER BY 1;
5. id | data
6. ----+--------------------
7. 1 | <value>one</value>
8. 2 | <value>two</value>
9. (2 rows)
10. openGauss= SELECT xmlconcat('', NULL, '');
11. xmlconcat
12. (1 row)
13. openGauss= SELECT xmlconcat('', NULL, '');
14. xmlconcat
15. (1 row)

XML类型 - 图2 说明:

  • 该功能默认未开启,如需使用,需要修改openGauss-server源码中的cmake/src/build_options.cmake文件,将143行set(USE_LIBXML OFF)去掉,重新使用build/script中cmake_package_mini.sh脚本编译数据库;详细使用指导见企业版。