From 2a9303b3d9407ff257015cf796e7c4c65aa33ebf Mon Sep 17 00:00:00 2001 From: yanguotao Date: Tue, 15 Oct 2024 14:05:27 +0800 Subject: [PATCH] =?UTF-8?q?gms=5Fi18n=E9=AB=98=E7=BA=A7=E5=8C=85=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...8n\351\253\230\347\272\247\345\214\205.md" | 30 +++++++++++ .../ExtensionReference/gms_i18n-Extension.md | 9 ++++ .../gms_i18n\344\275\277\347\224\250.md" | 52 +++++++++++++++++++ .../gms_i18n\345\256\211\350\243\205.md" | 3 ++ .../gms_i18n\346\246\202\350\277\260.md" | 3 ++ .../gms_i18n\351\231\220\345\210\266.md" | 3 ++ content/zh/menu/index.md | 6 +++ .../ExtensionReference/ExtensionReference.rst | 1 + .../ExtensionReference/gms_i18n-Extension.rst | 9 ++++ 9 files changed, 116 insertions(+) create mode 100644 "content/zh/docs/AboutopenGauss/gms_i18n\351\253\230\347\272\247\345\214\205.md" create mode 100644 content/zh/docs/ExtensionReference/gms_i18n-Extension.md create mode 100644 "content/zh/docs/ExtensionReference/gms_i18n\344\275\277\347\224\250.md" create mode 100644 "content/zh/docs/ExtensionReference/gms_i18n\345\256\211\350\243\205.md" create mode 100644 "content/zh/docs/ExtensionReference/gms_i18n\346\246\202\350\277\260.md" create mode 100644 "content/zh/docs/ExtensionReference/gms_i18n\351\231\220\345\210\266.md" create mode 100644 sphinx/source/ExtensionReference/gms_i18n-Extension.rst diff --git "a/content/zh/docs/AboutopenGauss/gms_i18n\351\253\230\347\272\247\345\214\205.md" "b/content/zh/docs/AboutopenGauss/gms_i18n\351\253\230\347\272\247\345\214\205.md" new file mode 100644 index 000000000..396a798c2 --- /dev/null +++ "b/content/zh/docs/AboutopenGauss/gms_i18n\351\253\230\347\272\247\345\214\205.md" @@ -0,0 +1,30 @@ +# gns_i18n高级包 + +## 可获得性 + +本特性自openGauss 7.0.0版本开始引入 + +## 特性简介 + +gms_i18n高级包主要实现国际化功能。在安装完数据库后,直接通过插件加载方式创建。 + +## 客户价值 + +gms_i18n高级包提供raw_to_char及string_to_raw字符串转换函数。 + +## 特性描述 +- 通过CREATE Extension命令进行插件创建。 +- 支持raw_to_char命令,将RAW数据从有效的字符集转换为数据库字符集中的VARCHAR字符串。 +- 支持string_to_raw命令,将VARCHAR符串转换为另一个有效的字符集,并将结果作为原始数据返回。 + +## 特性增强 + +无 + +## 特性约束 + +- 仅支持Create extension命令方式加载插件后再使用。 + +## 依赖关系 + +无。 \ No newline at end of file diff --git a/content/zh/docs/ExtensionReference/gms_i18n-Extension.md b/content/zh/docs/ExtensionReference/gms_i18n-Extension.md new file mode 100644 index 000000000..6948fe7a0 --- /dev/null +++ b/content/zh/docs/ExtensionReference/gms_i18n-Extension.md @@ -0,0 +1,9 @@ +# gms_i18n Extension + +- **[gms_i18n概述](gms_i18n概述.md)** + +- **[gms_i18n限制](gms_i18n限制.md)** + +- **[gms_i18n安装](gms_i18n安装.md)** + +- **[gms_i18n使用](gms_i18n使用.md)** \ No newline at end of file diff --git "a/content/zh/docs/ExtensionReference/gms_i18n\344\275\277\347\224\250.md" "b/content/zh/docs/ExtensionReference/gms_i18n\344\275\277\347\224\250.md" new file mode 100644 index 000000000..2eff28f42 --- /dev/null +++ "b/content/zh/docs/ExtensionReference/gms_i18n\344\275\277\347\224\250.md" @@ -0,0 +1,52 @@ +# gms_i18n使用 + +## 创建Extension + +创建gms_i18n Extension可直接使用CREATE Extension命令进行创建: + +``` +openGauss=# CREATE Extension gms_i18n; +``` + +## 使用Extension + +### 函数声明 +- RAW_TO_CHAR(data IN RAW, src_charset IN VARCHAR2 DEFAULT NULL) + 描述:将RAW数据从有效的字符集转换为数据库字符集中的VARCHAR字符串。 + 参数详解:data:raw类型数据,src_charset:源字符集。 +- GMS_I18N.STRING_TO_RAW(IN strdata varchar2, IN dst_chrset varchar2 DEFAULT NULL) + 描述:将VARCHAR字符串转换为另一个有效的字符集,并将结果作为原始数据返回分。 + 参数详解:strdata:需要转换的字符串;dst_chrset:目标字符集。 + +### 函数使用 +raw_to_char函数 +```sql +openGauss=# select gms_i18n.raw_to_char(hextoraw('616263646566C2AA'), 'utf8'); + raw_to_char +------------- + abcdefª +(1 row) + +``` + +strin_to_raw函数 +```sql +openGauss=# select gms_i18n.string_to_raw('abcdefª', 'utf8'); + string_to_raw +------------------ + 616263646566C2AA +(1 row) + +``` + +## 删除Extension + +在openGauss中删除gms_i18n Extension的方法如下所示: + +``` +openGauss=# DROP Extension gms_i18n [CASCADE]; +``` + +>![](public_sys-resources/icon-note.png) **说明:** +> +>如果Extension被其它对象依赖,需要加入CASCADE(级联)关键字,删除所有依赖对象。 diff --git "a/content/zh/docs/ExtensionReference/gms_i18n\345\256\211\350\243\205.md" "b/content/zh/docs/ExtensionReference/gms_i18n\345\256\211\350\243\205.md" new file mode 100644 index 000000000..f1da78d13 --- /dev/null +++ "b/content/zh/docs/ExtensionReference/gms_i18n\345\256\211\350\243\205.md" @@ -0,0 +1,3 @@ +# gms_i18n安装 + +openGauss打包编译时默认已经包含了gms_i18n, 可以在安装完openGauss后,直接通过create extension gms_i18n;加载插件。 \ No newline at end of file diff --git "a/content/zh/docs/ExtensionReference/gms_i18n\346\246\202\350\277\260.md" "b/content/zh/docs/ExtensionReference/gms_i18n\346\246\202\350\277\260.md" new file mode 100644 index 000000000..871750d60 --- /dev/null +++ "b/content/zh/docs/ExtensionReference/gms_i18n\346\246\202\350\277\260.md" @@ -0,0 +1,3 @@ +# gms_i18n概述 + +gms_i18n是一个基于openGauss的插件,提供国际化功能。目前支持的函数有:GMS_I18N.RAW_TO_CHAR、GMS_I18N.STRING_TO_RAW。 \ No newline at end of file diff --git "a/content/zh/docs/ExtensionReference/gms_i18n\351\231\220\345\210\266.md" "b/content/zh/docs/ExtensionReference/gms_i18n\351\231\220\345\210\266.md" new file mode 100644 index 000000000..5c2e79c40 --- /dev/null +++ "b/content/zh/docs/ExtensionReference/gms_i18n\351\231\220\345\210\266.md" @@ -0,0 +1,3 @@ +# gms_i18n限制 + +- 仅支持Create extension命令方式加载插件。 \ No newline at end of file diff --git a/content/zh/menu/index.md b/content/zh/menu/index.md index 64ac26844..3dceb5798 100644 --- a/content/zh/menu/index.md +++ b/content/zh/menu/index.md @@ -140,6 +140,7 @@ headless: true - [gms_output高级包]({{< relref "./docs/AboutopenGauss/gms_output工具包.md" >}}) - [gms_profiler高级包]({{< relref "./docs/AboutopenGauss/gms_profiler高级包.md" >}}) - [gms_stats高级包]({{< relref "./docs/AboutopenGauss/gms_stats高级包.md" >}}) + - [gms_i18n高级包]({{< relref "./docs/AboutopenGauss/gms_i18n高级包.md" >}}) - [应用开发接口]({{< relref "./docs/AboutopenGauss/应用开发接口.md" >}}) - [支持标准SQL]({{< relref "./docs/AboutopenGauss/支持标准SQL.md" >}}) - [支持标准开发接口]({{< relref "./docs/AboutopenGauss/支持标准开发接口.md" >}}) @@ -1104,6 +1105,11 @@ headless: true - [gms_profiler限制]({{< relref "./docs/ExtensionReference/gms_profiler限制.md" >}}) - [gms_profiler安装]({{< relref "./docs/ExtensionReference/gms_profiler安装.md" >}}) - [gms_profiler使用]({{< relref "./docs/ExtensionReference/gms_profiler使用.md" >}}) + - [gms_i18n Extension]({{< relref "./docs/ExtensionReference/gms_i18n-Extension.md" >}}) + - [gms_i18n概述]({{< relref "./docs/ExtensionReference/gms_i18n概述.md" >}}) + - [gms_i18n限制]({{< relref "./docs/ExtensionReference/gms_i18n限制.md" >}}) + - [gms_i18n安装]({{< relref "./docs/ExtensionReference/gms_i18n安装.md" >}}) + - [gms_i18n使用]({{< relref "./docs/ExtensionReference/gms_i18n使用.md" >}}) - [SPQPlugin Extension]({{< relref "./docs/ExtensionReference/spqplugin-Extension.md" >}}) - [SPQPlugin概述]({{< relref "./docs/ExtensionReference/spqplugin概述.md" >}}) - [SPQPlugin限制]({{< relref "./docs/ExtensionReference/spqplugin限制.md" >}}) diff --git a/sphinx/source/ExtensionReference/ExtensionReference.rst b/sphinx/source/ExtensionReference/ExtensionReference.rst index dd2e8da33..16c5fa423 100644 --- a/sphinx/source/ExtensionReference/ExtensionReference.rst +++ b/sphinx/source/ExtensionReference/ExtensionReference.rst @@ -9,4 +9,5 @@ gms_output-Extension datavec-Extension gms_profiler-Extension + gms_i18n-Extension diff --git a/sphinx/source/ExtensionReference/gms_i18n-Extension.rst b/sphinx/source/ExtensionReference/gms_i18n-Extension.rst new file mode 100644 index 000000000..dbda9f360 --- /dev/null +++ b/sphinx/source/ExtensionReference/gms_i18n-Extension.rst @@ -0,0 +1,9 @@ +gms_i18n-Extension +====================== + +.. toctree:: + + ../content/zh/docs/ExtensionReference/gms_i18n概述 + ../content/zh/docs/ExtensionReference/gms_i18n安装 + ../content/zh/docs/ExtensionReference/gms_i18n使用 + ../content/zh/docs/ExtensionReference/gms_i18n限制 -- Gitee