From e00e25c27cb823d01dea44b2912c7d4967d0ad18 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Mon, 19 Feb 2024 18:00:06 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix(mogdb):gs=5Fctl=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BB=8B=E7=BB=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools-used-in-the-internal-system/4-gs_ctl.md | 3 ++- .../tool-reference/tools-used-in-the-internal-system/gs_ctl.md | 3 ++- .../tool-reference/tools-used-in-the-internal-system/gs_ctl.md | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/tools-used-in-the-internal-system/4-gs_ctl.md b/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/tools-used-in-the-internal-system/4-gs_ctl.md index 72389ea8..91241709 100644 --- a/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/tools-used-in-the-internal-system/4-gs_ctl.md +++ b/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/tools-used-in-the-internal-system/4-gs_ctl.md @@ -55,6 +55,7 @@ gs_ctl工具由操作系统用户omm执行。 | -q | 生成完成个后不自动启动,需要调用者启动。 | 无参数 | | -P PASSWORD | 与-U参数配合使用,指定连接本地数据库的用户密码。
说明:
当省略-U参数,且认证方法为trust时,-P参数无效。 | - | | -U USERNAME | 指定连接数据库的用户。此参数只能与notify、query、failover、switchover和querybuild参数配合使用。对于域用户,使用DOMAIN\username格式。 | 取值范围:MogDB中存在的用户。
默认值:省略此参数则使用与当前操作系统用户同名的用户。 | +| -Z NODE-TYPE | 节点类型。
说明:
在完全单机的情况下,如果wal_level是WAL_LEVEL_MINIMAL,或者max_wal_senders<1,并且数据库启动模式是primary/standby/pending模式,则gs_ctl start命令需要加-Z single_node参数。 | single_node | | -?, -h, --help | 显示关于gs_ctl命令行参数的帮助信息。 | - | **表 3** start或restart共有参数 @@ -63,7 +64,7 @@ gs_ctl工具由操作系统用户omm执行。 | :------------------ | :----------------------------------------------------------- | :----------------------------------------------------------- | | -c, --core-file | 允许mogdb进程产生内核文件。 | - | | -l, --log=FILENAME | 把服务器日志输出附加在FILENAME文件上。 | FILENAME的取值为启动数据库服务的用户有权限的文件。
例如,data目录下的某文件。 | -| -o OPTIONS | 声明要直接传递给由MogDB执行的mogdb的命令行选项。参数通常都用单或者双引号包围以保证它们作为一个整体传递。 | mogdb支持的参数。 | +| -o OPTIONS | 声明要直接传递给由MogDB执行的mogdb的命令行选项。参数通常都用单或者双引号包围以保证它们作为一个整体传递。 | [mogdb](./1-mogdb.md)支持的参数。 | | -p PATH-TO-POSTGRES | 声明mogdb可执行文件的位置。 | 缺省位于gs_ctl自身所在目录,一般不需要此选项。 | **表 4** stop和restart共有参数 diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/tools-used-in-the-internal-system/gs_ctl.md b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/tools-used-in-the-internal-system/gs_ctl.md index 9ccb7704..2a69207c 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/tools-used-in-the-internal-system/gs_ctl.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/tools-used-in-the-internal-system/gs_ctl.md @@ -69,6 +69,7 @@ gs_ctl参数可分为如下几类: | -q | 生成完成个后不自动启动,需要调用者启动。 | 无参数 | | -P PASSWORD | 与-U参数配合使用,指定连接本地数据库的用户密码。
说明:
当省略-U参数,且认证方法为trust时,-P参数无效。 | - | | -U USERNAME | 指定连接数据库的用户。此参数只能与notify、query、failover、switchover和querybuild参数配合使用。对于域用户,使用DOMAIN\username格式。 | 取值范围:MogDB中存在的用户。
默认值:省略此参数则使用与当前操作系统用户同名的用户。 | +| -Z NODE-TYPE | 节点类型。
说明:
在完全单机的情况下,如果wal_level是WAL_LEVEL_MINIMAL,或者max_wal_senders<1,并且数据库启动模式是primary/standby/pending模式,则gs_ctl start命令需要加-Z single_node参数。 | single_node | | -?, -h, --help | 显示关于gs_ctl命令行参数的帮助信息。 | - | **表 3** start或restart共有参数 @@ -77,7 +78,7 @@ gs_ctl参数可分为如下几类: | :------------------ | :----------------------------------------------------------- | :----------------------------------------------------------- | | -c, --core-file | 允许mogdb进程产生内核文件。 | - | | -l, --log=FILENAME | 把服务器日志输出附加在FILENAME文件上。 | FILENAME的取值为启动数据库服务的用户有权限的文件。
例如,data目录下的某文件。 | -| -o OPTIONS | 声明要直接传递给由MogDB执行的mogdb的命令行选项。
参数通常都用单或者双引号包围以保证它们作为一个整体传递。 | mogdb支持的参数。 | +| -o OPTIONS | 声明要直接传递给由MogDB执行的mogdb的命令行选项。
参数通常都用单或者双引号包围以保证它们作为一个整体传递。 | [mogdb](./mogdb.md)支持的参数。 | | -p PATH-TO-POSTGRES | 声明mogdb可执行文件的位置。 | 缺省位于gs_ctl自身所在目录,一般不需要此选项。 | **表 4** stop和restart共有参数 diff --git a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/tools-used-in-the-internal-system/gs_ctl.md b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/tools-used-in-the-internal-system/gs_ctl.md index 0b48f596..be6fa3ab 100644 --- a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/tools-used-in-the-internal-system/gs_ctl.md +++ b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/tools-used-in-the-internal-system/gs_ctl.md @@ -72,6 +72,7 @@ gs_ctl参数可分为如下几类: | -q | 生成完成个后不自动启动,需要调用者启动。 | 无参数 | | -P PASSWORD | 与-U参数配合使用,指定连接本地数据库的用户密码。
说明:
当省略-U参数,且认证方法为trust时,-P参数无效。 | - | | -U USERNAME | 指定连接数据库的用户。此参数只能与notify、query、failover、switchover和querybuild参数配合使用。对于域用户,使用DOMAIN\username格式。 | 取值范围:MogDB中存在的用户。
默认值:省略此参数则使用与当前操作系统用户同名的用户。 | +| -Z NODE-TYPE | 节点类型。
说明:
在完全单机的情况下,如果wal_level是WAL_LEVEL_MINIMAL,或者max_wal_senders<1,并且数据库启动模式是primary/standby/pending模式,则gs_ctl start命令需要加-Z single_node参数。 | single_node | | -?, -h, --help | 显示关于gs_ctl命令行参数的帮助信息。 | - | **表 3** start或restart共有参数 @@ -80,7 +81,7 @@ gs_ctl参数可分为如下几类: | :------------------ | :----------------------------------------------------------- | :----------------------------------------------------------- | | -c, --core-file | 允许mogdb进程产生内核文件。 | - | | -l, --log=FILENAME | 把服务器日志输出附加在FILENAME文件上。 | FILENAME的取值为启动数据库服务的用户有权限的文件。
例如,data目录下的某文件。 | -| -o OPTIONS | 声明要直接传递给由MogDB执行的mogdb的命令行选项。
参数通常都用单或者双引号包围以保证它们作为一个整体传递。 | mogdb支持的参数。 | +| -o OPTIONS | 声明要直接传递给由MogDB执行的mogdb的命令行选项。
参数通常都用单或者双引号包围以保证它们作为一个整体传递。 | [mogdb](./mogdb.md)支持的参数。 | | -p PATH-TO-POSTGRES | 声明mogdb可执行文件的位置。 | 缺省位于gs_ctl自身所在目录,一般不需要此选项。 | **表 4** stop和restart共有参数 -- Gitee From 407640ee0a4fe7d3ac17525f285f76ddb68968c7 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Tue, 20 Feb 2024 10:36:24 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix(mogdb):gs=5Fdump=E5=92=8Cgs=5Fdumpall?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tool-reference/server-tools/5-gs_dump.md | 10 ++++++---- .../tool-reference/server-tools/6-gs_dumpall.md | 1 + .../tool-reference/server-tools/gs_dump.md | 2 ++ .../tool-reference/server-tools/gs_dumpall.md | 1 + .../tool-reference/server-tools/gs_dump.md | 2 ++ .../tool-reference/server-tools/gs_dumpall.md | 1 + .../tool-reference/server-tools/5-gs_dump.md | 1 + .../tool-reference/server-tools/6-gs_dumpall.md | 1 + .../tool-reference/server-tools/gs_dump.md | 1 + .../tool-reference/server-tools/gs_dumpall.md | 1 + .../tool-reference/server-tools/gs_dump.md | 3 ++- .../tool-reference/server-tools/gs_dumpall.md | 1 + 12 files changed, 20 insertions(+), 5 deletions(-) diff --git a/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/5-gs_dump.md b/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/5-gs_dump.md index 64dfb226..8f8009cf 100644 --- a/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/5-gs_dump.md +++ b/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/5-gs_dump.md @@ -9,7 +9,7 @@ date: 2021-06-07 ## Background -**gs_dump**, provided by MogDB, is used to export database information. You can export a database or its objects (such as schemas, tables, and views\), excluding objects in the recycle bin. The database can be the default **postgres** database or a user-specified database. +**gs_dump**, provided by MogDB, is used to export database information. You can export a database or its objects (such as schemas, tables, and views), excluding objects in the recycle bin. The database can be the default **postgres** database or a user-specified database. **gs_dump** is executed by OS user **omm**. @@ -19,7 +19,7 @@ When **gs_dump** is used to export data, other users can still access (read and The generated columns are not dumped when gs_dump is used. -**gs\_dump** supports the export of text files that are compatible with the V1 database. +**gs_dump** supports the export of text files that are compatible with the V1 database. **gs_dump** can export database information to a plain-text SQL script file or archive file. @@ -41,13 +41,15 @@ The generated columns are not dumped when gs_dump is used. > ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **NOTE:** > -> To reduce the size of an exported file, you can use the gs\_dump tool to compress it to a directory archive file or custom-format file. When a directory archive or custom-format archive is generated, a medium level of compression is applied by default. Archived exported files cannot be compressed using **gs\_dump**. +> To reduce the size of an exported file, you can use the gs_dump tool to compress it to a directory archive file or custom-format file. When a directory archive or custom-format archive is generated, a medium level of compression is applied by default. Archived exported files cannot be compressed using **gs_dump**. ## Precautions +- gs_dump is only used for the primary node and does not support exporting data from the standby and cascade standby node. + - Do not modify an exported file or its content. Otherwise, restoration may fail. -- To ensure the data consistency and integrity, **gs\_dump** acquires a share lock on a table to be dumped. If another transaction has acquired a share lock on the table, **gs\_dump** waits until this lock is released and then locks the table for dumping. If the table cannot be locked within the specified time, the dump fails. You can customize the timeout duration to wait for lock release by specifying the **--lock-wait-timeout** option. +- To ensure the data consistency and integrity, **gs_dump** acquires a share lock on a table to be dumped. If another transaction has acquired a share lock on the table, **gs_dump** waits until this lock is released and then locks the table for dumping. If the table cannot be locked within the specified time, the dump fails. You can customize the timeout duration to wait for lock release by specifying the **--lock-wait-timeout** option. - Stored procedures and functions cannot be exported in encrypted mode. ## Syntax diff --git a/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/6-gs_dumpall.md b/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/6-gs_dumpall.md index 1abcfd77..f93bb8ef 100644 --- a/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/6-gs_dumpall.md +++ b/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/6-gs_dumpall.md @@ -28,6 +28,7 @@ The exported files are both plain-text SQL scripts. Use gsql to execute them to ## Precautions +- gs_dumpall is only used for the primary node and does not support exporting data from the standby and cascade standby node. - Do not modify an exported file or its content. Otherwise, restoration may fail. - To ensure the data consistency and integrity, **gs_dumpall** acquires a share lock on a table to be dumped. If another transaction has acquired a share lock on the table, **gs_dumpall** waits until this lock is released and then locks the table for dumping. If the table cannot be locked within the specified time, the dump fails. You can customize the timeout duration to wait for lock release by specifying the **-lock-wait-timeout** option. - During an export, **gs_dumpall** reads all tables in a database. Therefore, you need to connect to the database as an MogDB administrator to export a complete file. When you use **gsql** to execute SQL scripts, cluster administrator permissions are also required to add users and user groups, and create databases. diff --git a/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dump.md b/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dump.md index 326db720..9b725dec 100644 --- a/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dump.md +++ b/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dump.md @@ -45,6 +45,8 @@ The generated columns are not dumped when gs_dump is used. ## Precautions +- gs_dump is only used for the primary node and does not support exporting data from the standby and cascade standby node. + - Do not modify an exported file or its content. Otherwise, restoration may fail. - To ensure the data consistency and integrity, **gs\_dump** acquires a share lock on a table to be dumped. If another transaction has acquired a share lock on the table, **gs\_dump** waits until this lock is released and then locks the table for dumping. If the table cannot be locked within the specified time, the dump fails. You can customize the timeout duration to wait for lock release by specifying the **--lock-wait-timeout** option. diff --git a/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dumpall.md b/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dumpall.md index 5aad6d97..396f3cbe 100644 --- a/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dumpall.md +++ b/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dumpall.md @@ -28,6 +28,7 @@ The exported files are both plain-text SQL scripts. Use gsql to execute them to ## Precautions +- gs_dumpall is only used for the primary node and does not support exporting data from the standby and cascade standby node. - Do not modify an exported file or its content. Otherwise, restoration may fail. - To ensure the data consistency and integrity, **gs_dumpall** acquires a share lock on a table to be dumped. If another transaction has acquired a share lock on the table, **gs_dumpall** waits until this lock is released and then locks the table for dumping. If the table cannot be locked within the specified time, the dump fails. You can customize the timeout duration to wait for lock release by specifying the **-lock-wait-timeout** option. - During an export, **gs_dumpall** reads all tables in a database. Therefore, you need to connect to the database as an MogDB administrator to export a complete file. When you use **gsql** to execute SQL scripts, cluster administrator permissions are also required to add users and user groups, and create databases. diff --git a/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dump.md b/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dump.md index 326db720..9b725dec 100644 --- a/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dump.md +++ b/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dump.md @@ -45,6 +45,8 @@ The generated columns are not dumped when gs_dump is used. ## Precautions +- gs_dump is only used for the primary node and does not support exporting data from the standby and cascade standby node. + - Do not modify an exported file or its content. Otherwise, restoration may fail. - To ensure the data consistency and integrity, **gs\_dump** acquires a share lock on a table to be dumped. If another transaction has acquired a share lock on the table, **gs\_dump** waits until this lock is released and then locks the table for dumping. If the table cannot be locked within the specified time, the dump fails. You can customize the timeout duration to wait for lock release by specifying the **--lock-wait-timeout** option. diff --git a/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dumpall.md b/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dumpall.md index 5aad6d97..396f3cbe 100644 --- a/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dumpall.md +++ b/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dumpall.md @@ -28,6 +28,7 @@ The exported files are both plain-text SQL scripts. Use gsql to execute them to ## Precautions +- gs_dumpall is only used for the primary node and does not support exporting data from the standby and cascade standby node. - Do not modify an exported file or its content. Otherwise, restoration may fail. - To ensure the data consistency and integrity, **gs_dumpall** acquires a share lock on a table to be dumped. If another transaction has acquired a share lock on the table, **gs_dumpall** waits until this lock is released and then locks the table for dumping. If the table cannot be locked within the specified time, the dump fails. You can customize the timeout duration to wait for lock release by specifying the **-lock-wait-timeout** option. - During an export, **gs_dumpall** reads all tables in a database. Therefore, you need to connect to the database as an MogDB administrator to export a complete file. When you use **gsql** to execute SQL scripts, cluster administrator permissions are also required to add users and user groups, and create databases. diff --git a/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/5-gs_dump.md b/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/5-gs_dump.md index 6a2dfe27..436e2b82 100644 --- a/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/5-gs_dump.md +++ b/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/5-gs_dump.md @@ -43,6 +43,7 @@ gs_dump可以创建四种不同的导出文件格式,通过“-F”或者“-- ## 注意事项 +- gs_dump仅用于主库(Primary),不支持导出备库(Standby)和级联备(Cascade Standby)的数据。 - 禁止修改导出的文件和内容,否则可能无法恢复成功。 - 为了保证数据一致性和完整性,gs_dump会对需要转储的表设置共享锁。如果表在别的事务中设置了共享锁,gs_dump会等待锁释放后锁定表。如果无法在指定时间内锁定某个表,转储会失败。用户可以通过指定--lock-wait-timeout选项,自定义等待锁超时时间。 - 不支持加密导出存储过程和函数。 diff --git a/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/6-gs_dumpall.md b/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/6-gs_dumpall.md index 8ce98943..7eaabbcc 100644 --- a/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/6-gs_dumpall.md +++ b/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/server-tools/6-gs_dumpall.md @@ -28,6 +28,7 @@ gs_dumpall在导出MogDB所有数据库时分为两部分: ## 注意事项 +- gs_dumpall仅用于主库(Primary),不支持导出备库(Standby)和级联备(Cascade Standby)的数据。 - 禁止修改导出的文件和内容,否则可能无法恢复成功。 - 为了保证数据一致性和完整性,gs_dumpall会对需要转储的表设置共享锁。如果某张表在别的事务中设置了共享锁,gs_dumpall会等待此表的锁释放后锁定此表。如果无法在指定时间内锁定某张表,转储会失败。用户可以通过指定--lock-wait-timeout选项,自定义等待锁超时时间。 - 由于gs_dumpall读取所有数据库中的表,因此必须以MogDB管理员身份进行连接,才能导出完整文件。在使用gsql执行脚本文件导入时,同样需要管理员权限,以便添加用户和组,以及创建数据库。 diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dump.md b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dump.md index 335dc2ad..e6e74898 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dump.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dump.md @@ -43,6 +43,7 @@ gs_dump可以创建四种不同的导出文件格式,通过“-F”或者“ ## 注意事项 +- gs_dump仅用于主库(Primary),不支持导出备库(Standby)和级联备(Cascade Standby)的数据。 - 禁止修改-F c/d/t 格式导出的文件和内容,否则可能无法恢复成功。对于-F p 格式导出的文件,如有需要,可根据需要谨慎编辑导出文件。 - 为了保证数据一致性和完整性,gs_dump会对需要转储的表设置共享锁。如果表在别的事务中设置了共享锁,gs_dump会等待锁释放后锁定表。如果无法在指定时间内锁定某个表,转储会失败。用户可以通过指定--lock-wait-timeout选项,自定义等待锁超时时间。 - 不支持加密导出存储过程和函数。 diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dumpall.md b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dumpall.md index 7f3e24b0..181ceea4 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dumpall.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/server-tools/gs_dumpall.md @@ -28,6 +28,7 @@ gs_dumpall在导出MogDB所有数据库时分为两部分: ## 注意事项 +- gs_dumpall仅用于主库(Primary),不支持导出备库(Standby)和级联备(Cascade Standby)的数据。 - 禁止修改导出的文件和内容,否则可能无法恢复成功。 - 为了保证数据一致性和完整性,gs_dumpall会对需要转储的表设置共享锁。如果某张表在别的事务中设置了共享锁,gs_dumpall会等待此表的锁释放后锁定此表。如果无法在指定时间内锁定某张表,转储会失败。用户可以通过指定--lock-wait-timeout选项,自定义等待锁超时时间。 - 由于gs_dumpall读取所有数据库中的表,因此必须以MogDB管理员身份进行连接,才能导出完整文件。在使用gsql执行脚本文件导入时,同样需要管理员权限,以便添加用户和组,以及创建数据库。 diff --git a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dump.md b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dump.md index d589aecc..06ce6abd 100644 --- a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dump.md +++ b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dump.md @@ -26,7 +26,7 @@ gs_dump支持将数据库信息导出至纯文本格式的SQL脚本文件或其 - 纯文本格式的SQL脚本文件:包含将数据库恢复为其保存时的状态所需的SQL语句。通过gsql运行该SQL脚本文件,可以恢复数据库。即使在其他主机和其他数据库产品上,只要对SQL脚本文件稍作修改,也可以用来重建数据库。 - 归档格式文件:包含将数据库恢复为其保存时的状态所需的数据,可以是tar格式、目录归档格式或自定义归档格式,详见[表1](#daochuwenjian)。该导出结果必须与gs_restore配合使用来恢复数据库,gs_restore工具在导入时,系统允许用户选择需要导入的内容,甚至可以在导入之前对等待导入的内容进行排序。 -gs\_dump工具支持MySQL兼容性。(仅限于3.0.0,3.1.0,3.1.1的MySQL兼容性需求) +gs_dump工具支持MySQL兼容性。(仅限于3.0.0,3.1.0,3.1.1的MySQL兼容性需求) >![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-notice.gif) **须知**: > @@ -51,6 +51,7 @@ gs_dump可以创建四种不同的导出文件格式,通过“-F”或者“ ## 注意事项 +- gs_dump仅用于主库(Primary),不支持导出备库(Standby)和级联备(Cascade Standby)的数据。 - 禁止修改-F c/d/t 格式导出的文件和内容,否则可能无法恢复成功。对于-F p 格式导出的文件,如有需要,可根据需要谨慎编辑导出文件。 - 为了保证数据一致性和完整性,gs_dump会对需要转储的表设置共享锁。如果表在别的事务中设置了共享锁,gs_dump会等待锁释放后锁定表。如果无法在指定时间内锁定某个表,转储会失败。用户可以通过指定--lock-wait-timeout选项,自定义等待锁超时时间。 - 不支持加密导出存储过程和函数。 diff --git a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dumpall.md b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dumpall.md index 66cfd875..6cafb18f 100644 --- a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dumpall.md +++ b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/server-tools/gs_dumpall.md @@ -33,6 +33,7 @@ gs_dumpall在导出MogDB所有数据库时分为两部分: ## 注意事项 +- gs_dumpall仅用于主库(Primary),不支持导出备库(Standby)和级联备(Cascade Standby)的数据。 - 禁止修改导出的文件和内容,否则可能无法恢复成功。 - 为了保证数据一致性和完整性,gs_dumpall会对需要转储的表设置共享锁。如果某张表在别的事务中设置了共享锁,gs_dumpall会等待此表的锁释放后锁定此表。如果无法在指定时间内锁定某张表,转储会失败。用户可以通过指定--lock-wait-timeout选项,自定义等待锁超时时间。 - 由于gs_dumpall读取所有数据库中的表,因此必须以MogDB管理员身份进行连接,才能导出完整文件。在使用gsql执行脚本文件导入时,同样需要管理员权限,以便添加用户和组,以及创建数据库。 -- Gitee From f1fdd6d0d522eb7d4e16db97788da7e5617f6cad Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Tue, 20 Feb 2024 11:02:22 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix(mogdb):=E9=94=99=E5=88=AB=E5=AD=97?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=94=B9=E6=88=90=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../importing-data/5-using-gs_restore-to-import-data.md | 2 +- .../importing-data/5-using-gs_restore-to-import-data.md | 2 +- .../importing-data/5-using-gs_restore-to-import-data.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/product/zh/docs-mogdb/v3.0/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md b/product/zh/docs-mogdb/v3.0/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md index 43b8b7e0..5c96558b 100644 --- a/product/zh/docs-mogdb/v3.0/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md +++ b/product/zh/docs-mogdb/v3.0/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md @@ -244,7 +244,7 @@ backupdb=# select * from hr.areas; (4 rows) ``` -示例十三:用户user1不具备将导出文件中数据导入至数据库backupdb的权限,而角色role1具备该权限,要实现将文件数据导入数据库backupdb,可以在导出命令中设置-role角色为role1,使用role1的权限,完成导出目的。 +示例十三:用户user1不具备将导出文件中数据导入至数据库backupdb的权限,而角色role1具备该权限,要实现将文件数据导入数据库backupdb,可以在导入命令中设置-role角色为role1,使用role1的权限,完成导入目的。 ```sql human_resource=# CREATE USER user1 IDENTIFIED BY "1234@abc"; diff --git a/product/zh/docs-mogdb/v5.0/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md b/product/zh/docs-mogdb/v5.0/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md index b946ab8c..242e64ea 100644 --- a/product/zh/docs-mogdb/v5.0/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md +++ b/product/zh/docs-mogdb/v5.0/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md @@ -244,7 +244,7 @@ backupdb=# select * from hr.areas; (4 rows) ``` -示例十三:用户user1不具备将导出文件中数据导入至数据库backupdb的权限,而角色role1具备该权限,要实现将文件数据导入数据库backupdb,可以在导出命令中设置-role角色为role1,使用role1的权限,完成导出目的。 +示例十三:用户user1不具备将导出文件中数据导入至数据库backupdb的权限,而角色role1具备该权限,要实现将文件数据导入数据库backupdb,可以在导入命令中设置-role角色为role1,使用role1的权限,完成导入目的。 ```sql human_resource=# CREATE USER user1 IDENTIFIED BY "1234@abc"; diff --git a/product/zh/docs-mogdb/v5.1/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md b/product/zh/docs-mogdb/v5.1/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md index b946ab8c..242e64ea 100644 --- a/product/zh/docs-mogdb/v5.1/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md +++ b/product/zh/docs-mogdb/v5.1/administrator-guide/importing-and-exporting-data/importing-data/5-using-gs_restore-to-import-data.md @@ -244,7 +244,7 @@ backupdb=# select * from hr.areas; (4 rows) ``` -示例十三:用户user1不具备将导出文件中数据导入至数据库backupdb的权限,而角色role1具备该权限,要实现将文件数据导入数据库backupdb,可以在导出命令中设置-role角色为role1,使用role1的权限,完成导出目的。 +示例十三:用户user1不具备将导出文件中数据导入至数据库backupdb的权限,而角色role1具备该权限,要实现将文件数据导入数据库backupdb,可以在导入命令中设置-role角色为role1,使用role1的权限,完成导入目的。 ```sql human_resource=# CREATE USER user1 IDENTIFIED BY "1234@abc"; -- Gitee From 7592c74084799af33c6b7ca6fdc7f4de01b7baa8 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Wed, 21 Feb 2024 15:53:04 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix(mogdb):create=20table=20subpartition?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=87=8D=E5=A4=8D=E7=9A=84=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=88=97=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md | 6 ------ .../reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md | 6 ------ .../reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md | 6 ------ 3 files changed, 18 deletions(-) diff --git a/product/zh/docs-mogdb/v3.0/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md b/product/zh/docs-mogdb/v3.0/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md index f195f222..1b51b6c7 100644 --- a/product/zh/docs-mogdb/v3.0/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md +++ b/product/zh/docs-mogdb/v3.0/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md @@ -246,12 +246,6 @@ PARTITION BY {RANGE | LIST} (partition_key) SUBPARTITION BY {RANGE | LIST | HASH > - 修改和删除生成列的方法和普通列相同。删除生成列依赖的普通列,生成列被自动删除。不能改变生成列所依赖的列的类型。 > - 生成列不能被直接写入。在INSERT或UPDATE命令中,不能为生成列指定值,但是可以指定关键字DEFAULT。 > - 生成列的权限控制和普通列一样。 - > - 不能为生成列指定默认值。 - > - 生成列不能作为分区键的一部分。 - > - 生成列不能和ON UPDATE约束字句的CASCADE,SET NULL,SET DEFAULT动作同时指定。生成列不能和ON DELETE约束字句的SET NULL,SET DEFAULT动作同时指定。 - > - 修改和删除生成列的方法和普通列相同。删除生成列依赖的普通列,生成列被自动删除。不能改变生成列所依赖的列的类型。 - > - 生成列不能被直接写入。在INSERT或UPDATE命令中, 不能为生成列指定值, 但是可以指定关键字DEFAULT。 - > - 生成列的权限控制和普通列一样。 > - 列存表、内存表MOT不支持生成列。外表中仅postgres_fdw支持生成列。 - **UNIQUE index_parameters** diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md b/product/zh/docs-mogdb/v5.0/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md index 0d9e2edb..f8781afd 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md @@ -312,12 +312,6 @@ PARTITION BY {RANGE [ COLUMNS ] | LIST [ COLUMNS ] | HASH | KEY} (partition_key) > - 修改和删除生成列的方法和普通列相同。删除生成列依赖的普通列,生成列被自动删除。不能改变生成列所依赖的列的类型。 > - 生成列不能被直接写入。在INSERT或UPDATE命令中, 不能为生成列指定值, 但是可以指定关键字DEFAULT。 > - 生成列的权限控制和普通列一样。 - > - 不能为生成列指定默认值。 - > - 生成列不能作为分区键的一部分。 - > - 生成列不能和ON UPDATE约束字句的CASCADE、SET NULL、SET DEFAULT动作同时指定。生成列不能和ON DELETE约束字句的SET NULL、SET DEFAULT动作同时指定。 - > - 修改和删除生成列的方法和普通列相同。删除生成列依赖的普通列,生成列被自动删除。不能改变生成列所依赖的列的类型。 - > - 生成列不能被直接写入。在INSERT或UPDATE命令中, 不能为生成列指定值, 但是可以指定关键字DEFAULT。 - > - 生成列的权限控制和普通列一样。 > - 列存表、内存表MOT不支持生成列。外表中仅postgres_fdw支持生成列。 - **AUTO\_INCREMENT** diff --git a/product/zh/docs-mogdb/v5.1/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md b/product/zh/docs-mogdb/v5.1/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md index 0d9e2edb..f8781afd 100644 --- a/product/zh/docs-mogdb/v5.1/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md +++ b/product/zh/docs-mogdb/v5.1/reference-guide/sql-syntax/CREATE-TABLE-SUBPARTITION.md @@ -312,12 +312,6 @@ PARTITION BY {RANGE [ COLUMNS ] | LIST [ COLUMNS ] | HASH | KEY} (partition_key) > - 修改和删除生成列的方法和普通列相同。删除生成列依赖的普通列,生成列被自动删除。不能改变生成列所依赖的列的类型。 > - 生成列不能被直接写入。在INSERT或UPDATE命令中, 不能为生成列指定值, 但是可以指定关键字DEFAULT。 > - 生成列的权限控制和普通列一样。 - > - 不能为生成列指定默认值。 - > - 生成列不能作为分区键的一部分。 - > - 生成列不能和ON UPDATE约束字句的CASCADE、SET NULL、SET DEFAULT动作同时指定。生成列不能和ON DELETE约束字句的SET NULL、SET DEFAULT动作同时指定。 - > - 修改和删除生成列的方法和普通列相同。删除生成列依赖的普通列,生成列被自动删除。不能改变生成列所依赖的列的类型。 - > - 生成列不能被直接写入。在INSERT或UPDATE命令中, 不能为生成列指定值, 但是可以指定关键字DEFAULT。 - > - 生成列的权限控制和普通列一样。 > - 列存表、内存表MOT不支持生成列。外表中仅postgres_fdw支持生成列。 - **AUTO\_INCREMENT** -- Gitee From d1ff5fc3cbab6d4f82fc5930a44b46afd6199443 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Fri, 23 Feb 2024 14:17:54 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix(mogdb):=E4=BF=AE=E6=AD=A3=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E9=9D=A2=E9=94=99=E8=AF=AFtitle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- product/zh/docs-mogdb/v5.0/reference-guide/reference-guide.md | 4 ++-- .../sql-reference/transaction/transaction-management.md | 4 ++-- .../cm-configuration-parameter/cm-configuration-parameter.md | 4 ++-- .../introduction-to-installation-and-uninstallation-tool.md | 4 ++-- .../tool-reference/cluster-management/safety-design.md | 4 ++-- .../sql-reference/transaction/transaction-management.md | 4 ++-- .../cm-configuration-parameter/cm-configuration-parameter.md | 4 ++-- .../introduction-to-installation-and-uninstallation-tool.md | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/reference-guide.md b/product/zh/docs-mogdb/v5.0/reference-guide/reference-guide.md index 881889fe..31382fe2 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/reference-guide.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/reference-guide.md @@ -1,6 +1,6 @@ --- -title: dsscmd -summary: dsscmd +title: 参考指南 +summary: 参考指南 author: zhang cuiping date: 2023-04-07 --- diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/sql-reference/transaction/transaction-management.md b/product/zh/docs-mogdb/v5.0/reference-guide/sql-reference/transaction/transaction-management.md index 64fe77e5..5c80f61d 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/sql-reference/transaction/transaction-management.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/sql-reference/transaction/transaction-management.md @@ -1,6 +1,6 @@ --- -title: dsscmd -summary: dsscmd +title: 管理事务 +summary: 管理事务 author: zhang cuiping date: 2023-04-07 --- diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/cm-configuration-parameter/cm-configuration-parameter.md b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/cm-configuration-parameter/cm-configuration-parameter.md index 166e7592..2407d552 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/cm-configuration-parameter/cm-configuration-parameter.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/cm-configuration-parameter/cm-configuration-parameter.md @@ -1,6 +1,6 @@ --- -title: dsscmd -summary: dsscmd +title: CM配置参数介绍 +summary: CM配置参数介绍 author: zhang cuiping date: 2023-04-07 --- diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/introduction-to-installation-and-uninstallation-tool.md b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/introduction-to-installation-and-uninstallation-tool.md index a1c4b47b..8ef0e435 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/introduction-to-installation-and-uninstallation-tool.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/introduction-to-installation-and-uninstallation-tool.md @@ -1,6 +1,6 @@ --- -title: dsscmd -summary: dsscmd +title: 安装和卸载工具介绍 +summary: 安装和卸载工具介绍 author: zhang cuiping date: 2023-04-07 --- diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/safety-design.md b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/safety-design.md index 6321ac23..49dbab9c 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/safety-design.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/safety-design.md @@ -1,6 +1,6 @@ --- -title: dsscmd -summary: dsscmd +title: 安全设计 +summary: 安全设计 author: zhang cuiping date: 2023-04-07 --- diff --git a/product/zh/docs-mogdb/v5.1/reference-guide/sql-reference/transaction/transaction-management.md b/product/zh/docs-mogdb/v5.1/reference-guide/sql-reference/transaction/transaction-management.md index 64fe77e5..5c80f61d 100644 --- a/product/zh/docs-mogdb/v5.1/reference-guide/sql-reference/transaction/transaction-management.md +++ b/product/zh/docs-mogdb/v5.1/reference-guide/sql-reference/transaction/transaction-management.md @@ -1,6 +1,6 @@ --- -title: dsscmd -summary: dsscmd +title: 管理事务 +summary: 管理事务 author: zhang cuiping date: 2023-04-07 --- diff --git a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/cm-configuration-parameter/cm-configuration-parameter.md b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/cm-configuration-parameter/cm-configuration-parameter.md index 166e7592..2407d552 100644 --- a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/cm-configuration-parameter/cm-configuration-parameter.md +++ b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/cm-configuration-parameter/cm-configuration-parameter.md @@ -1,6 +1,6 @@ --- -title: dsscmd -summary: dsscmd +title: CM配置参数介绍 +summary: CM配置参数介绍 author: zhang cuiping date: 2023-04-07 --- diff --git a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/introduction-to-installation-and-uninstallation-tool.md b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/introduction-to-installation-and-uninstallation-tool.md index a1c4b47b..8ef0e435 100644 --- a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/introduction-to-installation-and-uninstallation-tool.md +++ b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/introduction-to-installation-and-uninstallation-tool.md @@ -1,6 +1,6 @@ --- -title: dsscmd -summary: dsscmd +title: 安装和卸载工具介绍 +summary: 安装和卸载工具介绍 author: zhang cuiping date: 2023-04-07 --- -- Gitee From bfba2177c04a7e97c1664729d0f472e259601ffa Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Fri, 23 Feb 2024 14:20:57 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix(mogdb):=E4=BF=AE=E6=AD=A3=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E9=9D=A2=E9=94=99=E8=AF=AFtitle=EF=BC=88en?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transaction/transaction-management.md | 344 +++++++++--------- .../transaction/transaction-management.md | 4 +- 2 files changed, 174 insertions(+), 174 deletions(-) diff --git a/product/en/docs-mogdb/v5.0/reference-guide/sql-reference/transaction/transaction-management.md b/product/en/docs-mogdb/v5.0/reference-guide/sql-reference/transaction/transaction-management.md index d11d61db..6ff08c79 100644 --- a/product/en/docs-mogdb/v5.0/reference-guide/sql-reference/transaction/transaction-management.md +++ b/product/en/docs-mogdb/v5.0/reference-guide/sql-reference/transaction/transaction-management.md @@ -1,173 +1,173 @@ ---- -title: dsscmd -summary: dsscmd -author: zhang cuiping -date: 2023-04-07 ---- - -# Transactions - -A transaction is a user-defined sequence of database operations, which form an integral unit of work. In MogDB, you can start, set, commit, and roll back transactions. MogDB supports the **READ COMMITTED** and **REPEATABLE READ** transaction isolation levels. - -- **READ COMMITTED**: At this level, a transaction can access only committed data. This is the default level. - - The SELECT statement accesses the snapshot of the database taken when the query begins. It can also access the data updates in its transaction, regardless of whether they have been committed. Note that different database snapshots may be available to two consecutive SELECT statements for the same transaction, because data may be committed for other transactions while the first SELECT statement is executed. - - At the **READ COMMITTED** level, the execution of each statement begins with a new snapshot, which contains all the transactions that have been committed at the execution time. Therefore, during a transaction, a statement can access the result of other committed transactions. Note whether a single statement always accesses absolutely consistent data in a database. - - Transaction isolation at this level meets the requirements of many applications, and is fast and easy to use. However, applications performing complicated queries and updates may require data that is more consistent than this level can provide. - -- **REPEATABLE READ**: A transaction can only read data committed before it starts. Uncommitted data or data committed in other concurrent transactions cannot be read. However, a query can read earlier data updates in its transaction, regardless of whether they have been committed. **READ UNCOMMITTED** differs from this level in that a transaction reads the snapshot taken at the start of the transaction, not at the beginning of the current query within the transaction. Therefore, the SELECT statement within a transaction always reads the same data, and cannot read data committed by other concurrent transactions after the transaction starts. Applications at this level must be able to retry transactions, because serialization failures may occur. - -## Syntax - -- Start a transaction. - - Execute the BEGIN statement to start a transaction. - - ```markdown - BEGIN [ WORK | TRANSACTION ] - [ - { - ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE | REPEATABLE READ } - | { READ WRITE | READ ONLY } - } [, ...] - ]; - ``` - - Execute the START TRANSACTION statement to start a transaction. - - ```markdown - START TRANSACTION - [ - { - ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE | REPEATABLE READ } - | { READ WRITE | READ ONLY } - } [, ...] - ]; - ``` - -- Set transaction features. - - Use the SET TRANSACTION statement or the syntax to set the isolation level and read/write mode of a transaction. - - ```less - { SET [ LOCAL ] TRANSACTION|SET SESSION CHARACTERISTICS AS TRANSACTION } - { ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE | REPEATABLE READ } - | { READ WRITE | READ ONLY } } [, ...]; - ``` - -- Commit a transaction. - - Execute the COMMIT or END statement to commit all operations of a transaction. - - ```less - { COMMIT | END } [ WORK | TRANSACTION ] ; - ``` - -- Roll back a transaction. - - If a fault occurs during a transaction and the transaction cannot proceed, the system performs rollback to cancel all the completed database operations related to the transaction. - - ```css - ROLLBACK [ WORK | TRANSACTION ]; - ``` - -## Parameter Description - -- **WORK | TRANSACTION** - - Specifies the optional keyword in BEGIN format without functions. - -- **ISOLATION LEVEL** - - Specifies the transaction isolation level that determines the data that a transaction can view if other concurrent transactions exist. - - > ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **NOTE:** The isolation level of a transaction cannot be reset after the first clause (**SELECT**, **INSERT**, **DELETE**, **UPDATE**, **FETCH**, or **COPY**) for modifying data is executed in the transaction. - - Value range: - - - **READ COMMITTED**: Only committed data is read. This is the default. - - **REPEATABLE READ**: Only the data committed before transaction start is read. Uncommitted data or data committed in other concurrent transactions cannot be read. - - **SERIALIZABLE**: Currently, this isolation level is not supported in functions. It is equivalent to **REPEATABLE READ**. - -- **READ WRITE | READ ONLY** - - Specifies the transaction access mode (read/write or read only). - -- **LOCAL** - - Specifies that the specified statement takes effect only for the current transaction. - -- **SESSION** - - Specifies that the specified statement takes effect for the current session. - - Value range: a string. It must comply with the identifier naming convention. - -- **COMMIT | END** - - Commits the current transaction and makes all changes made by the transaction become visible to others. - -## Examples - -Assume that the **customer_t1** table exists and contains the following data: - -```sql -MogDB=# SELECT * FROM customer_t1; - c_customer_sk | c_customer_id | c_first_name | c_last_name | amount ----------------+---------------+--------------+-------------+-------- - 3769 | hello | Grace | | 1000 - 3769 | | Grace | | - 3769 | hello | | | - 6885 | maps | Joes | | 2200 - 4321 | tpcds | Lily | | 3000 - 9527 | world | James | | 5000 -(6 rows) -``` - -Start a transaction, delete the row where **amount** is set to **1000** from the table, and execute the ROLLBACK statement to undo all changes. - -```sql -MogDB=# START TRANSACTION; -MogDB=# DELETE FROM customer_t1 WHERE amount = 1000; -MogDB=# ROLLBACK; -``` - -In the **customer_t1** table, the row where **amount** is set to **1000** still exists. - -```sql -MogDB=# select * from customer_t1; - c_customer_sk | c_customer_id | c_first_name | c_last_name | amount ----------------+---------------+--------------+-------------+-------- - 3769 | hello | Grace | | 1000 - 3769 | | Grace | | - 3769 | hello | | | - 6885 | maps | Joes | | 2200 - 4321 | tpcds | Lily | | 3000 - 9527 | world | James | | 5000 -(6 rows) -``` - -Start another transaction, delete the record whose **amount** is set to **1000** from the table, and execute the COMMIT command to commit all changes. - -```sql --- Start a transaction and set its isolation level to READ COMMITTED and access mode to READ ONLY. -MogDB=# BEGIN; -MogDB=# DELETE FROM customer_t1 WHERE amount = 1000; -MogDB=# COMMIT; -``` - -The record whose **amount** is set to **1000** has been deleted from the **customer_t1** table. - -```sql -MogDB=# select * from customer_t1; - c_customer_sk | c_customer_id | c_first_name | c_last_name | amount ----------------+---------------+--------------+-------------+-------- - 3769 | | Grace | | - 3769 | hello | | | - 6885 | maps | Joes | | 2200 - 4321 | tpcds | Lily | | 3000 - 9527 | world | James | | 5000 -(5 rows) +--- +title: Transactions +summary: Transactions +author: zhang cuiping +date: 2023-04-07 +--- + +# Transactions + +A transaction is a user-defined sequence of database operations, which form an integral unit of work. In MogDB, you can start, set, commit, and roll back transactions. MogDB supports the **READ COMMITTED** and **REPEATABLE READ** transaction isolation levels. + +- **READ COMMITTED**: At this level, a transaction can access only committed data. This is the default level. + + The SELECT statement accesses the snapshot of the database taken when the query begins. It can also access the data updates in its transaction, regardless of whether they have been committed. Note that different database snapshots may be available to two consecutive SELECT statements for the same transaction, because data may be committed for other transactions while the first SELECT statement is executed. + + At the **READ COMMITTED** level, the execution of each statement begins with a new snapshot, which contains all the transactions that have been committed at the execution time. Therefore, during a transaction, a statement can access the result of other committed transactions. Note whether a single statement always accesses absolutely consistent data in a database. + + Transaction isolation at this level meets the requirements of many applications, and is fast and easy to use. However, applications performing complicated queries and updates may require data that is more consistent than this level can provide. + +- **REPEATABLE READ**: A transaction can only read data committed before it starts. Uncommitted data or data committed in other concurrent transactions cannot be read. However, a query can read earlier data updates in its transaction, regardless of whether they have been committed. **READ UNCOMMITTED** differs from this level in that a transaction reads the snapshot taken at the start of the transaction, not at the beginning of the current query within the transaction. Therefore, the SELECT statement within a transaction always reads the same data, and cannot read data committed by other concurrent transactions after the transaction starts. Applications at this level must be able to retry transactions, because serialization failures may occur. + +## Syntax + +- Start a transaction. + + Execute the BEGIN statement to start a transaction. + + ```markdown + BEGIN [ WORK | TRANSACTION ] + [ + { + ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE | REPEATABLE READ } + | { READ WRITE | READ ONLY } + } [, ...] + ]; + ``` + + Execute the START TRANSACTION statement to start a transaction. + + ```markdown + START TRANSACTION + [ + { + ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE | REPEATABLE READ } + | { READ WRITE | READ ONLY } + } [, ...] + ]; + ``` + +- Set transaction features. + + Use the SET TRANSACTION statement or the syntax to set the isolation level and read/write mode of a transaction. + + ```less + { SET [ LOCAL ] TRANSACTION|SET SESSION CHARACTERISTICS AS TRANSACTION } + { ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE | REPEATABLE READ } + | { READ WRITE | READ ONLY } } [, ...]; + ``` + +- Commit a transaction. + + Execute the COMMIT or END statement to commit all operations of a transaction. + + ```less + { COMMIT | END } [ WORK | TRANSACTION ] ; + ``` + +- Roll back a transaction. + + If a fault occurs during a transaction and the transaction cannot proceed, the system performs rollback to cancel all the completed database operations related to the transaction. + + ```css + ROLLBACK [ WORK | TRANSACTION ]; + ``` + +## Parameter Description + +- **WORK | TRANSACTION** + + Specifies the optional keyword in BEGIN format without functions. + +- **ISOLATION LEVEL** + + Specifies the transaction isolation level that determines the data that a transaction can view if other concurrent transactions exist. + + > ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **NOTE:** The isolation level of a transaction cannot be reset after the first clause (**SELECT**, **INSERT**, **DELETE**, **UPDATE**, **FETCH**, or **COPY**) for modifying data is executed in the transaction. + + Value range: + + - **READ COMMITTED**: Only committed data is read. This is the default. + - **REPEATABLE READ**: Only the data committed before transaction start is read. Uncommitted data or data committed in other concurrent transactions cannot be read. + - **SERIALIZABLE**: Currently, this isolation level is not supported in functions. It is equivalent to **REPEATABLE READ**. + +- **READ WRITE | READ ONLY** + + Specifies the transaction access mode (read/write or read only). + +- **LOCAL** + + Specifies that the specified statement takes effect only for the current transaction. + +- **SESSION** + + Specifies that the specified statement takes effect for the current session. + + Value range: a string. It must comply with the identifier naming convention. + +- **COMMIT | END** + + Commits the current transaction and makes all changes made by the transaction become visible to others. + +## Examples + +Assume that the **customer_t1** table exists and contains the following data: + +```sql +MogDB=# SELECT * FROM customer_t1; + c_customer_sk | c_customer_id | c_first_name | c_last_name | amount +---------------+---------------+--------------+-------------+-------- + 3769 | hello | Grace | | 1000 + 3769 | | Grace | | + 3769 | hello | | | + 6885 | maps | Joes | | 2200 + 4321 | tpcds | Lily | | 3000 + 9527 | world | James | | 5000 +(6 rows) +``` + +Start a transaction, delete the row where **amount** is set to **1000** from the table, and execute the ROLLBACK statement to undo all changes. + +```sql +MogDB=# START TRANSACTION; +MogDB=# DELETE FROM customer_t1 WHERE amount = 1000; +MogDB=# ROLLBACK; +``` + +In the **customer_t1** table, the row where **amount** is set to **1000** still exists. + +```sql +MogDB=# select * from customer_t1; + c_customer_sk | c_customer_id | c_first_name | c_last_name | amount +---------------+---------------+--------------+-------------+-------- + 3769 | hello | Grace | | 1000 + 3769 | | Grace | | + 3769 | hello | | | + 6885 | maps | Joes | | 2200 + 4321 | tpcds | Lily | | 3000 + 9527 | world | James | | 5000 +(6 rows) +``` + +Start another transaction, delete the record whose **amount** is set to **1000** from the table, and execute the COMMIT command to commit all changes. + +```sql +-- Start a transaction and set its isolation level to READ COMMITTED and access mode to READ ONLY. +MogDB=# BEGIN; +MogDB=# DELETE FROM customer_t1 WHERE amount = 1000; +MogDB=# COMMIT; +``` + +The record whose **amount** is set to **1000** has been deleted from the **customer_t1** table. + +```sql +MogDB=# select * from customer_t1; + c_customer_sk | c_customer_id | c_first_name | c_last_name | amount +---------------+---------------+--------------+-------------+-------- + 3769 | | Grace | | + 3769 | hello | | | + 6885 | maps | Joes | | 2200 + 4321 | tpcds | Lily | | 3000 + 9527 | world | James | | 5000 +(5 rows) ``` \ No newline at end of file diff --git a/product/en/docs-mogdb/v5.1/reference-guide/sql-reference/transaction/transaction-management.md b/product/en/docs-mogdb/v5.1/reference-guide/sql-reference/transaction/transaction-management.md index 4bea0f1b..6ff08c79 100644 --- a/product/en/docs-mogdb/v5.1/reference-guide/sql-reference/transaction/transaction-management.md +++ b/product/en/docs-mogdb/v5.1/reference-guide/sql-reference/transaction/transaction-management.md @@ -1,6 +1,6 @@ --- -title: dsscmd -summary: dsscmd +title: Transactions +summary: Transactions author: zhang cuiping date: 2023-04-07 --- -- Gitee From ee4ae6e01fc08235c3cbdc04d8c7d669d9a2ba4c Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Fri, 23 Feb 2024 14:29:00 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix(mogdb):unbind=5Fdive=5Fbound=E6=94=B9?= =?UTF-8?q?=E4=B8=BAunbind=5Fdivide=5Fbound?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../24-miscellaneous-parameters.md | 2 +- .../2-platform-and-client-compatibility.md | 2 +- .../2-platform-and-client-compatibility.md | 2 +- .../2-platform-and-client-compatibility.md | 2 +- .../2-platform-and-client-compatibility.md | 2 +- .../platform-and-client-compatibility.md | 384 +++++++++--------- .../platform-and-client-compatibility.md | 2 +- .../24-miscellaneous-parameters.md | 2 +- .../2-platform-and-client-compatibility.md | 2 +- .../2-platform-and-client-compatibility.md | 2 +- .../2-platform-and-client-compatibility.md | 2 +- .../2-platform-and-client-compatibility.md | 2 +- .../platform-and-client-compatibility.md | 4 +- .../platform-and-client-compatibility.md | 2 +- 14 files changed, 206 insertions(+), 206 deletions(-) diff --git a/product/en/docs-mogdb/v1.1/reference-guide/guc-parameters/24-miscellaneous-parameters.md b/product/en/docs-mogdb/v1.1/reference-guide/guc-parameters/24-miscellaneous-parameters.md index d7c74868..689d092d 100644 --- a/product/en/docs-mogdb/v1.1/reference-guide/guc-parameters/24-miscellaneous-parameters.md +++ b/product/en/docs-mogdb/v1.1/reference-guide/guc-parameters/24-miscellaneous-parameters.md @@ -259,7 +259,7 @@ This parameter is a USERSET parameter. Set it based on instructions provided in | bind_schema_tablespace | Binds a schema with the tablespace with the same name.If a tablespace name is the same as *sche_name*, **default_tablespace** will also be set to *sche_name* if **search_path** is set to *sche_name*. | | bind_procedure_searchpath | Specifies the search path of the database object for which no schema name is specified.If no schema name is specified for a stored procedure, the search is performed in the schema to which the stored procedure belongs.If the stored procedure is not found, the following operations are performed:If this item is not specified, the system reports an error and exits.If this item is specified, the search continues based on the settings of **search_path**. If the issue persists, the system reports an error and exits. | | correct_to_number | Controls the compatibility of the to_number() result.If this item is specified, the result of the to_number() function is the same as that of PG11. Otherwise, the result is the same as that of the O database. | -| unbind_dive_bound | Controls the range check on the result of integer division.If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | +| unbind_divide_bound | Controls the range check on the result of integer division.If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | | merge_update_multi | Performs an update if multiple rows are matched for **MERGE INTO**.If this item is specified, no error is reported if multiple rows are matched. Otherwise, an error is reported (same as the O database). | | return_null_string | Specifies how to display the empty result (empty string ") of the lpad() and rpad() functions.If this item is not specified, the empty string is displayed as **NULL**.
`postgres=# select length(lpad('123',0,'*')) from dual; length (1 row)`
If this item is specified, the empty string is displayed as single quotation marks (").
`postgres=# select length(lpad('123',0,'*')) from dual; length 0 (1 row)` | | compat_concat_variadic | Specifies the compatibility of variadic results of the concat() and concat_ws() functions.If this item is specified and a concat function has a parameter of the variadic type, different result formats in O and Teradata are retained. If this item is not specified and a concat function has a parameter of the variadic type, the result format of O is retained for both O and Teradata. This option has no effect on MY because MY has no variadic type. | diff --git a/product/en/docs-mogdb/v2.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md b/product/en/docs-mogdb/v2.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md index b6d0c933..a152a769 100644 --- a/product/en/docs-mogdb/v2.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md +++ b/product/en/docs-mogdb/v2.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md @@ -119,7 +119,7 @@ This parameter is a USERSET parameter. Set it based on instructions provided in | bind_schema_tablespace | Binds a schema with the tablespace with the same name.
If a tablespace name is the same as *sche_name*, **default_tablespace** will also be set to *sche_name* if **search_path** is set to *sche_name*. | | bind_procedure_searchpath | Specifies the search path of the database object for which no schema name is specified.
If no schema name is specified for a stored procedure, the search is performed in the schema to which the stored procedure belongs.
If the stored procedure is not found, the following operations are performed:
- If this item is not specified, the system reports an error and exits.
- If this item is specified, the search continues based on the settings of **search_path**. If the issue persists, the system reports an error and exits. | | correct_to_number | Controls the compatibility of the to_number() result.
If this item is specified, the result of the to_number() function is the same as that of PG11. Otherwise, the result is the same as that of the O database. | -| unbind_dive_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | +| unbind_divide_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | | merge_update_multi | Performs an update if multiple rows are matched for **MERGE INTO**.
If this item is specified, no error is reported if multiple rows are matched. Otherwise, an error is reported (same as the O database). | | return_null_string | Specifies how to display the empty result (empty string ") of the lpad() and rpad() functions.
- If this item is not specified, the empty string is displayed as **NULL**.
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- (1 row)`
- If this item is specified, the empty string is displayed as single quotation marks (").
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- 0 (1 row)` | | compat_concat_variadic | Specifies the compatibility of variadic results of the concat() and concat_ws() functions.
If this item is specified and a concat function has a parameter of the variadic type, different result formats in O and Teradata are retained. If this item is not specified and a concat function has a parameter of the variadic type, the result format of O is retained for both O and Teradata. This option has no effect on MY because MY has no variadic type. | diff --git a/product/en/docs-mogdb/v2.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md b/product/en/docs-mogdb/v2.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md index 7e0d7338..3153bdd3 100644 --- a/product/en/docs-mogdb/v2.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md +++ b/product/en/docs-mogdb/v2.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md @@ -119,7 +119,7 @@ This parameter is a USERSET parameter. Set it based on instructions provided in | bind_schema_tablespace | Binds a schema with the tablespace with the same name.
If a tablespace name is the same as *sche_name*, **default_tablespace** will also be set to *sche_name* if **search_path** is set to *sche_name*. | | bind_procedure_searchpath | Specifies the search path of the database object for which no schema name is specified.
If no schema name is specified for a stored procedure, the search is performed in the schema to which the stored procedure belongs.
If the stored procedure is not found, the following operations are performed:
- If this item is not specified, the system reports an error and exits.
- If this item is specified, the search continues based on the settings of **search_path**. If the issue persists, the system reports an error and exits. | | correct_to_number | Controls the compatibility of the to_number() result.
If this item is specified, the result of the to_number() function is the same as that of PG11. Otherwise, the result is the same as that of the O database. | -| unbind_dive_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | +| unbind_divide_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | | merge_update_multi | Performs an update if multiple rows are matched for **MERGE INTO**.
If this item is specified, no error is reported if multiple rows are matched. Otherwise, an error is reported (same as the O database). | | return_null_string | Specifies how to display the empty result (empty string ") of the lpad() and rpad() functions.
- If this item is not specified, the empty string is displayed as **NULL**.
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- (1 row)`
- If this item is specified, the empty string is displayed as single quotation marks (").
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- 0 (1 row)` | | compat_concat_variadic | Specifies the compatibility of variadic results of the concat() and concat_ws() functions.
If this item is specified and a concat function has a parameter of the variadic type, different result formats in O and Teradata are retained. If this item is not specified and a concat function has a parameter of the variadic type, the result format of O is retained for both O and Teradata. This option has no effect on MY because MY has no variadic type. | diff --git a/product/en/docs-mogdb/v3.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md b/product/en/docs-mogdb/v3.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md index 0666ddc4..acb25b2a 100644 --- a/product/en/docs-mogdb/v3.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md +++ b/product/en/docs-mogdb/v3.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md @@ -121,7 +121,7 @@ This parameter is a USERSET parameter. Set it based on instructions provided in | bind_schema_tablespace | Binds a schema with the tablespace with the same name.
If a tablespace name is the same as *sche_name*, **default_tablespace** will also be set to *sche_name* if **search_path** is set to *sche_name*. | | bind_procedure_searchpath | Specifies the search path of the database object for which no schema name is specified.
If no schema name is specified for a stored procedure, the search is performed in the schema to which the stored procedure belongs.
If the stored procedure is not found, the following operations are performed:
- If this item is not specified, the system reports an error and exits.
- If this item is specified, the search continues based on the settings of **search_path**. If the issue persists, the system reports an error and exits. | | correct_to_number | Controls the compatibility of the to_number() result.
If this item is specified, the result of the to_number() function is the same as that of PG11. Otherwise, the result is the same as that of the O database. | -| unbind_dive_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | +| unbind_divide_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | | return_null_string | Specifies how to display the empty result (empty string ") of the lpad() and rpad() functions.
- If this item is not specified, the empty string is displayed as **NULL**.
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- (1 row)`
- If this item is specified, the empty string is displayed as single quotation marks (").
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- 0 (1 row)` | | compat_concat_variadic | Specifies the compatibility of variadic results of the concat() and concat_ws() functions.
If this item is specified and a concat function has a parameter of the variadic type, different result formats in O and Teradata are retained. If this item is not specified and a concat function has a parameter of the variadic type, the result format of O is retained for both O and Teradata. This option has no effect on MY because MY has no variadic type. | | merge_update_multi | When MERGE INTO… WHEN MATCHED THEN UPDATE (see **MERGE INTO**) and INSERT… ON DUPLICATE KEY UPDATE (see **INSERT**) are used, control the UPDATE behavior if a piece of target data in the target table conflicts with multiple pieces of source data.
If this item is specified and the preceding scenario exists, the system performs multiple UPDATE operations on the conflicting row. If this item is not specified and the preceding scenario exists, an error is reported, that is, the MERGE or INSERT operation fails. | diff --git a/product/en/docs-mogdb/v3.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md b/product/en/docs-mogdb/v3.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md index 9e3d45cf..7b9c19e4 100644 --- a/product/en/docs-mogdb/v3.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md +++ b/product/en/docs-mogdb/v3.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md @@ -132,7 +132,7 @@ This parameter is a USERSET parameter. Set it based on instructions provided in | bind_schema_tablespace | Binds a schema with the tablespace with the same name.
If a tablespace name is the same as *sche_name*, **default_tablespace** will also be set to *sche_name* if **search_path** is set to *sche_name*. | | bind_procedure_searchpath | Specifies the search path of the database object for which no schema name is specified.
If no schema name is specified for a stored procedure, the search is performed in the schema to which the stored procedure belongs.
If the stored procedure is not found, the following operations are performed:
- If this item is not specified, the system reports an error and exits.
- If this item is specified, the search continues based on the settings of **search_path**. If the issue persists, the system reports an error and exits. | | correct_to_number | Controls the compatibility of the to_number() result.
If this item is specified, the result of the to_number() function is the same as that of PG11. Otherwise, the result is the same as that of the O database. | -| unbind_dive_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | +| unbind_divide_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | | return_null_string | Specifies how to display the empty result (empty string ") of the lpad() and rpad() functions.
- If this item is not specified, the empty string is displayed as **NULL**.
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- (1 row)`
- If this item is specified, the empty string is displayed as single quotation marks (").
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- 0 (1 row)` | | compat_concat_variadic | Specifies the compatibility of variadic results of the concat() and concat_ws() functions.
If this item is specified and a concat function has a parameter of the variadic type, different result formats in O and Teradata are retained. If this item is not specified and a concat function has a parameter of the variadic type, the result format of O is retained for both O and Teradata. This option has no effect on MY because MY has no variadic type. | | merge_update_multi | When MERGE INTO… WHEN MATCHED THEN UPDATE (see **MERGE INTO**) and INSERT… ON DUPLICATE KEY UPDATE (see **INSERT**) are used, control the UPDATE behavior if a piece of target data in the target table conflicts with multiple pieces of source data.
If this item is specified and the preceding scenario exists, the system performs multiple UPDATE operations on the conflicting row. If this item is not specified and the preceding scenario exists, an error is reported, that is, the MERGE or INSERT operation fails. | diff --git a/product/en/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md b/product/en/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md index 6fd34c55..758bee5a 100644 --- a/product/en/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md +++ b/product/en/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md @@ -1,192 +1,192 @@ ---- -title: Platform and Client Compatibility -summary: Platform and Client Compatibility -author: Zhang Cuiping -date: 2021-04-20 ---- - -# Platform and Client Compatibility - -Many platforms use the database system. External compatibility of the database system provides a lot of convenience for platforms. - -## convert_string_to_digit - -**Parameter description:** Specifies the implicit conversion priority, which determines whether to preferentially convert strings into numbers. - -This parameter is a USERSET parameter. Set it based on instructions provided in Table 1 [GUC parameters](../../../reference-guide/guc-parameters/appendix.md). - -**Value range**: Boolean - -- **on** indicates that strings are preferentially converted into numbers. -- **off** indicates that strings are not preferentially converted into numbers. - -**Default value**: **on** - -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-notice.gif) **NOTICE:** Adjusting this parameter will change the internal data type conversion rule and cause unexpected behavior. Exercise caution when performing this operation. - -## nls_timestamp_format - -**Parameter description:** Specifies the default timestamp format. - -This parameter is a USERSET parameter. Set it based on instructions provided in Table 1 [GUC parameters](../../../reference-guide/guc-parameters/appendix.md). - -**Value range**: a string - -**Default value**: **DD-Mon-YYYY HH:MI:SS.FF AM** - -## max_function_args - -**Parameter description**: Specifies the maximum number of parameters allowed for a function. - -This parameter is a fixed INTERNAL parameter and cannot be modified. - -**Value range**: an integer. - -**Default value**: **8192** - -## transform_null_equals - -**Parameter description**: Specifies whether expressions of the form expr = NULL (or NULL = expr) are treated as expr IS NULL. They return true if expr evaluates to **NULL**, and false otherwise. - -- The correct SQL-standard-compliant behavior of expr = NULL is to always return null (unknown). -- Filtered forms in Microsoft Access generate queries that appear to use expr = NULL to test for null values. If you enable this parameter, you can use this interface to access the database. - -This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 [Methods for setting GUC parameters](../../../reference-guide/guc-parameters/appendix.md). - -**Value range**: Boolean - -- **on** indicates expressions of the form expr = NULL (or NULL = expr) are treated as expr IS NULL. -- **off** indicates expr = NULL always returns NULL. - -**Default value**: **off** - -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **NOTE:** -> New users are always confused about the semantics of expressions involving **NULL** values. Therefore, **off** is used as the default value. - -## support_extended_features - -**Parameter description**: Specifies whether extended database features are supported. - -This parameter is a POSTMASTER parameter. Set it based on instructions provided in Table 2 [Methods for setting GUC parameters](../../../reference-guide/guc-parameters/appendix.md). - -**Value range**: Boolean - -- **on** indicates that extended database features are supported. -- **off** indicates that extended database features are not supported. - -**Default value**: **off** - -## sql_compatibility - -**Parameter description**: Specifies the type of mainstream database with which the SQL syntax and statement behavior of the database is compatible. - -This parameter is an INTERNAL parameter. It can be viewed but cannot be modified. - -**Value range**: enumerated values - -- **A** indicates that the database is compatible with the O database. -- **B** indicates that the database is compatible with the MY database. -- **C** indicates that the database is compatible with the TD database. -- **PG** indicates that the database is compatible with the PostgreSQL database. - -**Default value**: **A** - -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-notice.gif) **NOTICE:** -> -> - This parameter can be set only by dbcompatibility when you run the [CREATE DATABASE](../../../reference-guide/sql-syntax/CREATE-DATABASE.md) command to create a database. -> - In the database, this parameter must be set to a specific value. It can be set to **A** or **B** and cannot be changed randomly. Otherwise, the setting is not consistent with the database behavior. - -## enable_set_variables_b_format - -**Parameter description:** Specifies whether the function of customizing user variables is supported in the MY-compatible database. - -This parameter is a USERSET parameter. Set it based on instructions provided in Table 1 [GUC parameters](../appendix.md). - -**Value range**: Boolean - -- **on** indicates that user variables can be customized in the MY-compatible database. -- **off** indicates that user variables cannot be customized in the MY-compatible database. - -## behavior_compat_options - -**Parameter description**: Specifies database compatibility behavior. Multiple items are separated by commas (,). - -This parameter is a USERSET parameter. Set it based on instructions provided in Table 1 [GUC parameters](../appendix.md). - -**Value range**: a string - -**Default value:** empty - -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **NOTE:** -> -> - Currently, only compatibility configuration items in Table 1 [GUC parameters](../../../reference-guide/guc-parameters/appendix.md) are supported. -> - Multiple items are separated by commas (,), for example, **set behavior_compat_options='end_month_calculate,display_leading_zero';**. - -**Table 1** Compatibility configuration items - -| Configuration Item | Behavior | -| :------------------------------ | :----------------------------------------------------------- | -| display_leading_zero | Specifies how floating point numbers are displayed.
- If this item is not specified, for a decimal number between -1 and 1, the 0 before the decimal point is not displayed. For example, 0.25 is displayed as **.25**.
- If this item is specified, for a decimal number between -1 and 1, the 0 before the decimal point is displayed. For example, 0.25 is displayed as **0.25**. | -| end_month_calculate | Specifies the calculation logic of the add_months function.
Assume that the two parameters of the add_months function are **param1** and **param2**, and that the month of **param1** and **param2** is **result**.
- If this item is not specified, and the **Day** of **param1** indicates the last day of a month shorter than **result**, the **Day** in the calculation result will equal that in **param1**. For example:
`mogdb=# select add_months('2018-02-28',3) from sys_dummy; add_months ---------------------- 2018-05-28 00:00:00 (1 row)`
- If this item is specified, and the **Day** of **param1** indicates the last day of a month shorter than **result**, the **Day** in the calculation result will equal that in **result**. For example:
`mogdb=# select add_months('2018-02-28',3) from sys_dummy; add_months ---------------------- 2018-05-31 00:00:00 (1 row)` | -| compat_analyze_sample | Specifies the sampling behavior of the ANALYZE operation.
If this item is specified, the sample collected by the ANALYZE operation will be limited to around 30,000 records, DBnode memory consumption and maintaining the stability of ANALYZE. | -| bind_schema_tablespace | Binds a schema with the tablespace with the same name.
If a tablespace name is the same as *sche_name*, **default_tablespace** will also be set to *sche_name* if **search_path** is set to *sche_name*. | -| bind_procedure_searchpath | Specifies the search path of the database object for which no schema name is specified.
If no schema name is specified for a stored procedure, the search is performed in the schema to which the stored procedure belongs.
If the stored procedure is not found, the following operations are performed:
- If this item is not specified, the system reports an error and exits.
- If this item is specified, the search continues based on the settings of **search_path**. If the issue persists, the system reports an error and exits. | -| correct_to_number | Controls the compatibility of the to_number() result.
If this item is specified, the result of the to_number() function is the same as that of PG11. Otherwise, the result is the same as that of the O database. | -| unbind_dive_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | -| return_null_string | Specifies how to display the empty result (empty string ") of the lpad() and rpad() functions.
- If this item is not specified, the empty string is displayed as **NULL**.
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- (1 row)`
- If this item is specified, the empty string is displayed as single quotation marks (").
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- 0 (1 row)` | -| compat_concat_variadic | Specifies the compatibility of variadic results of the concat() and concat_ws() functions.
If this item is specified and a concat function has a parameter of the variadic type, different result formats in O and Teradata are retained. If this item is not specified and a concat function has a parameter of the variadic type, the result format of O is retained for both O and Teradata. This option has no effect on MY because MY has no variadic type. | -| merge_update_multi | When MERGE INTO… WHEN MATCHED THEN UPDATE (see **MERGE INTO**) and INSERT… ON DUPLICATE KEY UPDATE (see **INSERT**) are used, control the UPDATE behavior if a piece of target data in the target table conflicts with multiple pieces of source data.
If this item is specified and the preceding scenario exists, the system performs multiple UPDATE operations on the conflicting row. If this item is not specified and the preceding scenario exists, an error is reported, that is, the MERGE or INSERT operation fails. | -| hide_tailing_zero | Numeric shows the configuration item. If this parameter is not set, numeric shows the configuration item based on the specified precision. When this parameter is set, hide "0" at the end of the decimal point.
`set behavior_compat_options='hide_tailing_zero'; select cast(123.123 as numeric(15,10)); numeric ---- 123.123 (1 row)` | -| rownum_type_compat | Specifies the ROWNUM type. The default value is **INT8**. After this parameter is specified, the value is changed to **NUMERIC**. | -| aformat_null_test | Determines the logic for checking whether the row type is not null. When this parameter is set, if a column in a row is not null, **true** is returned.
When this parameter is not set, if all columns in a row are not null, **true** is returned. | -| aformat_regexp_match | Determines the matching behavior of regular expression functions.
When this parameter is set and **sql_compatibility** is set to **A** or **B**, the options supported by the **flags** parameter of the regular expression are changed as follows:
1. By default, the character '\n' cannot be matched.
2. When **flags** contains the **n** option, the character '\n' can be matched.
3. The **regexp_replace(source, pattern replacement)** function replaces all matching substrings.
4. **regexp_replace(source, pattern, replacement, flags)** returns null when the value of **flags** is **“** or null.
Otherwise, the meanings of the options supported by the **flags** parameter of the regular expression are as follows:
1. By default, the character '\n' can be matched.
2. The **n** option in **flags** indicates that the multi-line matching mode is used.
3. The **regexp_replace(source, pattern replacement)** function replaces only the first matched substring.
4. If the value of **flags** is **“** or null, the return value of **regexp_replace(source, pattern, replacement, flags)** is the character string after replacement. | -| compat_cursor | Determines the compatibility behavior of implicit cursor states. If this parameter is set and the O compatibility mode is used, the effective scope of implicit cursor states (**SQL %FOUND**, **SQL %NOTFOUND**, **SQL %ISOPNE** and **SQL %ROWCOUNT**) are extended only the currently executed function to all subfunctions invoked by this function. | -| proc_outparam_override | Determines the reloading of output parameters of a stored procedure. After this parameter is enabled, the stored procedure can be properly invoked even if only the output parameters of the stored procedure are different. | -| proc_implicit_for_loop_variable | Determines the behavior of the **FOR_LOOP** query statement in a stored procedure.When this parameter is set, if **rec** has been defined in the **FOR rec IN query LOOP** statement, the defined **rec** variable is not reused and a new variable is created. Otherwise, the defined **rec** variable is reused and no new variable is created. | -| allow_procedure_compile_check | Determines the compilation check of the **SELECT** and **OPEN CURSOR** statements in a stored procedure. If this parameter is set, when the **SELECT**, **OPEN CURSOR FOR**, **CURSOR %rowtype**, or **for rec in** statement is executed in a stored procedure, the stored procedure cannot be created if the queried table does not exist, and the compilation check of the trigger function is not supported. If the queried table exists, the stored procedure is successfully created. | -| char_coerce_compat | Determines the behavior when char(n) types are converted to other variable-length string types. By default, spaces at the end are omitted when the char(n) type is converted to other variable-length string types. After this parameter is enabled, spaces at the end are not omitted during conversion. In addition, if the length of the char(n) type exceeds the length of other variable-length string types, an error is reported. This parameter is valid only when **sql_compatibility** is set to **A**. | -| pgformat_substr | Controls the performance of substr(str, from, for) in different scenarios. By default, if the value of **from** is less than 0, substr counts from the end of the string. If the value of **for** is less than 1, substr returns NULL. After this parameter is enabled, if the value of **from** is less than 0, substr counts from the first (-from + 1) bit of the character string. If the value of **for** is less than 0, substr reports an error. This parameter is valid only when `sql_compatibility` is set to `PG`. | - -## plpgsql.variable_conflict - -**Parameter description**: Specifies the priority of a stored procedure variable and a table column that have the same name. - -This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 [Methods for setting GUC parameters](../../../reference-guide/guc-parameters/appendix.md). - -**Value range**: String - -- **error** indicates that an error is reported during compilation if the name of a stored procedure variable and that of a table column are the same. -- **use_variable** indicates that the variable is preferentially used if the name of a stored procedure variable and that of a table column are the same. -- **use_column** indicates that the column is preferentially used if the name of a stored procedure variable and that of a table column are the same. - -**Default value**: **error** - -## td_compatible_truncation - -**Parameter description**: Specifies whether to enable features compatible with a Teradata database. You can set this parameter to **on** when connecting to a database compatible with the TD database, so that when you perform the INSERT operation, overlong strings are truncated based on the allowed maximum length before being inserted into char- and varchar-type columns in the target table. This ensures all data is inserted into the target table without errors reported. - -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **NOTE:** -> The string truncation function cannot be used if the INSERT statement includes a foreign table. -> If inserting multi-byte character data (such as Chinese characters) to database with the character set byte encoding (SQL_ASCII, LATIN1), and the character data crosses the truncation position, the string is truncated based on its bytes instead of characters. Unexpected result will occur in tail after the truncation. If you want correct truncation result, you are advised to adopt encoding set such as UTF8, which has no character data crossing the truncation position. - -This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 [Methods for setting GUC parameters](../../../reference-guide/guc-parameters/appendix.md). - -**Value range**: Boolean - -- **on** indicates overlong strings are truncated. -- **off** indicates overlong strings are not truncated. - -**Default value**: **off** - -## lastval_supported - -**Parameter description**: Specifies whether to enable the **lastval** function. - -This parameter is a POSTMASTER parameter. Set it based on instructions provided in Table 1 [GUC parameters](../../../reference-guide/guc-parameters/appendix.md). - -**Value range**: Boolean - -- **on** indicates that the **lastval** function is supported. Additionally, the **nextval** function does not support push-down. -- **off** indicates that the **lastval** function is not supported. Additionally, the **nextval** function supports push-down. - -**Default value**: **off** +--- +title: Platform and Client Compatibility +summary: Platform and Client Compatibility +author: Zhang Cuiping +date: 2021-04-20 +--- + +# Platform and Client Compatibility + +Many platforms use the database system. External compatibility of the database system provides a lot of convenience for platforms. + +## convert_string_to_digit + +**Parameter description:** Specifies the implicit conversion priority, which determines whether to preferentially convert strings into numbers. + +This parameter is a USERSET parameter. Set it based on instructions provided in Table 1 [GUC parameters](../../../reference-guide/guc-parameters/appendix.md). + +**Value range**: Boolean + +- **on** indicates that strings are preferentially converted into numbers. +- **off** indicates that strings are not preferentially converted into numbers. + +**Default value**: **on** + +> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-notice.gif) **NOTICE:** Adjusting this parameter will change the internal data type conversion rule and cause unexpected behavior. Exercise caution when performing this operation. + +## nls_timestamp_format + +**Parameter description:** Specifies the default timestamp format. + +This parameter is a USERSET parameter. Set it based on instructions provided in Table 1 [GUC parameters](../../../reference-guide/guc-parameters/appendix.md). + +**Value range**: a string + +**Default value**: **DD-Mon-YYYY HH:MI:SS.FF AM** + +## max_function_args + +**Parameter description**: Specifies the maximum number of parameters allowed for a function. + +This parameter is a fixed INTERNAL parameter and cannot be modified. + +**Value range**: an integer. + +**Default value**: **8192** + +## transform_null_equals + +**Parameter description**: Specifies whether expressions of the form expr = NULL (or NULL = expr) are treated as expr IS NULL. They return true if expr evaluates to **NULL**, and false otherwise. + +- The correct SQL-standard-compliant behavior of expr = NULL is to always return null (unknown). +- Filtered forms in Microsoft Access generate queries that appear to use expr = NULL to test for null values. If you enable this parameter, you can use this interface to access the database. + +This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 [Methods for setting GUC parameters](../../../reference-guide/guc-parameters/appendix.md). + +**Value range**: Boolean + +- **on** indicates expressions of the form expr = NULL (or NULL = expr) are treated as expr IS NULL. +- **off** indicates expr = NULL always returns NULL. + +**Default value**: **off** + +> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **NOTE:** +> New users are always confused about the semantics of expressions involving **NULL** values. Therefore, **off** is used as the default value. + +## support_extended_features + +**Parameter description**: Specifies whether extended database features are supported. + +This parameter is a POSTMASTER parameter. Set it based on instructions provided in Table 2 [Methods for setting GUC parameters](../../../reference-guide/guc-parameters/appendix.md). + +**Value range**: Boolean + +- **on** indicates that extended database features are supported. +- **off** indicates that extended database features are not supported. + +**Default value**: **off** + +## sql_compatibility + +**Parameter description**: Specifies the type of mainstream database with which the SQL syntax and statement behavior of the database is compatible. + +This parameter is an INTERNAL parameter. It can be viewed but cannot be modified. + +**Value range**: enumerated values + +- **A** indicates that the database is compatible with the O database. +- **B** indicates that the database is compatible with the MY database. +- **C** indicates that the database is compatible with the TD database. +- **PG** indicates that the database is compatible with the PostgreSQL database. + +**Default value**: **A** + +> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-notice.gif) **NOTICE:** +> +> - This parameter can be set only by dbcompatibility when you run the [CREATE DATABASE](../../../reference-guide/sql-syntax/CREATE-DATABASE.md) command to create a database. +> - In the database, this parameter must be set to a specific value. It can be set to **A** or **B** and cannot be changed randomly. Otherwise, the setting is not consistent with the database behavior. + +## enable_set_variables_b_format + +**Parameter description:** Specifies whether the function of customizing user variables is supported in the MY-compatible database. + +This parameter is a USERSET parameter. Set it based on instructions provided in Table 1 [GUC parameters](../appendix.md). + +**Value range**: Boolean + +- **on** indicates that user variables can be customized in the MY-compatible database. +- **off** indicates that user variables cannot be customized in the MY-compatible database. + +## behavior_compat_options + +**Parameter description**: Specifies database compatibility behavior. Multiple items are separated by commas (,). + +This parameter is a USERSET parameter. Set it based on instructions provided in Table 1 [GUC parameters](../appendix.md). + +**Value range**: a string + +**Default value:** empty + +> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **NOTE:** +> +> - Currently, only compatibility configuration items in Table 1 [GUC parameters](../../../reference-guide/guc-parameters/appendix.md) are supported. +> - Multiple items are separated by commas (,), for example, **set behavior_compat_options='end_month_calculate,display_leading_zero';**. + +**Table 1** Compatibility configuration items + +| Configuration Item | Behavior | +| :------------------------------ | :----------------------------------------------------------- | +| display_leading_zero | Specifies how floating point numbers are displayed.
- If this item is not specified, for a decimal number between -1 and 1, the 0 before the decimal point is not displayed. For example, 0.25 is displayed as **.25**.
- If this item is specified, for a decimal number between -1 and 1, the 0 before the decimal point is displayed. For example, 0.25 is displayed as **0.25**. | +| end_month_calculate | Specifies the calculation logic of the add_months function.
Assume that the two parameters of the add_months function are **param1** and **param2**, and that the month of **param1** and **param2** is **result**.
- If this item is not specified, and the **Day** of **param1** indicates the last day of a month shorter than **result**, the **Day** in the calculation result will equal that in **param1**. For example:
`mogdb=# select add_months('2018-02-28',3) from sys_dummy; add_months ---------------------- 2018-05-28 00:00:00 (1 row)`
- If this item is specified, and the **Day** of **param1** indicates the last day of a month shorter than **result**, the **Day** in the calculation result will equal that in **result**. For example:
`mogdb=# select add_months('2018-02-28',3) from sys_dummy; add_months ---------------------- 2018-05-31 00:00:00 (1 row)` | +| compat_analyze_sample | Specifies the sampling behavior of the ANALYZE operation.
If this item is specified, the sample collected by the ANALYZE operation will be limited to around 30,000 records, DBnode memory consumption and maintaining the stability of ANALYZE. | +| bind_schema_tablespace | Binds a schema with the tablespace with the same name.
If a tablespace name is the same as *sche_name*, **default_tablespace** will also be set to *sche_name* if **search_path** is set to *sche_name*. | +| bind_procedure_searchpath | Specifies the search path of the database object for which no schema name is specified.
If no schema name is specified for a stored procedure, the search is performed in the schema to which the stored procedure belongs.
If the stored procedure is not found, the following operations are performed:
- If this item is not specified, the system reports an error and exits.
- If this item is specified, the search continues based on the settings of **search_path**. If the issue persists, the system reports an error and exits. | +| correct_to_number | Controls the compatibility of the to_number() result.
If this item is specified, the result of the to_number() function is the same as that of PG11. Otherwise, the result is the same as that of the O database. | +| unbind_divide_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | +| return_null_string | Specifies how to display the empty result (empty string ") of the lpad() and rpad() functions.
- If this item is not specified, the empty string is displayed as **NULL**.
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- (1 row)`
- If this item is specified, the empty string is displayed as single quotation marks (").
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- 0 (1 row)` | +| compat_concat_variadic | Specifies the compatibility of variadic results of the concat() and concat_ws() functions.
If this item is specified and a concat function has a parameter of the variadic type, different result formats in O and Teradata are retained. If this item is not specified and a concat function has a parameter of the variadic type, the result format of O is retained for both O and Teradata. This option has no effect on MY because MY has no variadic type. | +| merge_update_multi | When MERGE INTO… WHEN MATCHED THEN UPDATE (see **MERGE INTO**) and INSERT… ON DUPLICATE KEY UPDATE (see **INSERT**) are used, control the UPDATE behavior if a piece of target data in the target table conflicts with multiple pieces of source data.
If this item is specified and the preceding scenario exists, the system performs multiple UPDATE operations on the conflicting row. If this item is not specified and the preceding scenario exists, an error is reported, that is, the MERGE or INSERT operation fails. | +| hide_tailing_zero | Numeric shows the configuration item. If this parameter is not set, numeric shows the configuration item based on the specified precision. When this parameter is set, hide "0" at the end of the decimal point.
`set behavior_compat_options='hide_tailing_zero'; select cast(123.123 as numeric(15,10)); numeric ---- 123.123 (1 row)` | +| rownum_type_compat | Specifies the ROWNUM type. The default value is **INT8**. After this parameter is specified, the value is changed to **NUMERIC**. | +| aformat_null_test | Determines the logic for checking whether the row type is not null. When this parameter is set, if a column in a row is not null, **true** is returned.
When this parameter is not set, if all columns in a row are not null, **true** is returned. | +| aformat_regexp_match | Determines the matching behavior of regular expression functions.
When this parameter is set and **sql_compatibility** is set to **A** or **B**, the options supported by the **flags** parameter of the regular expression are changed as follows:
1. By default, the character '\n' cannot be matched.
2. When **flags** contains the **n** option, the character '\n' can be matched.
3. The **regexp_replace(source, pattern replacement)** function replaces all matching substrings.
4. **regexp_replace(source, pattern, replacement, flags)** returns null when the value of **flags** is **“** or null.
Otherwise, the meanings of the options supported by the **flags** parameter of the regular expression are as follows:
1. By default, the character '\n' can be matched.
2. The **n** option in **flags** indicates that the multi-line matching mode is used.
3. The **regexp_replace(source, pattern replacement)** function replaces only the first matched substring.
4. If the value of **flags** is **“** or null, the return value of **regexp_replace(source, pattern, replacement, flags)** is the character string after replacement. | +| compat_cursor | Determines the compatibility behavior of implicit cursor states. If this parameter is set and the O compatibility mode is used, the effective scope of implicit cursor states (**SQL %FOUND**, **SQL %NOTFOUND**, **SQL %ISOPNE** and **SQL %ROWCOUNT**) are extended only the currently executed function to all subfunctions invoked by this function. | +| proc_outparam_override | Determines the reloading of output parameters of a stored procedure. After this parameter is enabled, the stored procedure can be properly invoked even if only the output parameters of the stored procedure are different. | +| proc_implicit_for_loop_variable | Determines the behavior of the **FOR_LOOP** query statement in a stored procedure.When this parameter is set, if **rec** has been defined in the **FOR rec IN query LOOP** statement, the defined **rec** variable is not reused and a new variable is created. Otherwise, the defined **rec** variable is reused and no new variable is created. | +| allow_procedure_compile_check | Determines the compilation check of the **SELECT** and **OPEN CURSOR** statements in a stored procedure. If this parameter is set, when the **SELECT**, **OPEN CURSOR FOR**, **CURSOR %rowtype**, or **for rec in** statement is executed in a stored procedure, the stored procedure cannot be created if the queried table does not exist, and the compilation check of the trigger function is not supported. If the queried table exists, the stored procedure is successfully created. | +| char_coerce_compat | Determines the behavior when char(n) types are converted to other variable-length string types. By default, spaces at the end are omitted when the char(n) type is converted to other variable-length string types. After this parameter is enabled, spaces at the end are not omitted during conversion. In addition, if the length of the char(n) type exceeds the length of other variable-length string types, an error is reported. This parameter is valid only when **sql_compatibility** is set to **A**. | +| pgformat_substr | Controls the performance of substr(str, from, for) in different scenarios. By default, if the value of **from** is less than 0, substr counts from the end of the string. If the value of **for** is less than 1, substr returns NULL. After this parameter is enabled, if the value of **from** is less than 0, substr counts from the first (-from + 1) bit of the character string. If the value of **for** is less than 0, substr reports an error. This parameter is valid only when `sql_compatibility` is set to `PG`. | + +## plpgsql.variable_conflict + +**Parameter description**: Specifies the priority of a stored procedure variable and a table column that have the same name. + +This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 [Methods for setting GUC parameters](../../../reference-guide/guc-parameters/appendix.md). + +**Value range**: String + +- **error** indicates that an error is reported during compilation if the name of a stored procedure variable and that of a table column are the same. +- **use_variable** indicates that the variable is preferentially used if the name of a stored procedure variable and that of a table column are the same. +- **use_column** indicates that the column is preferentially used if the name of a stored procedure variable and that of a table column are the same. + +**Default value**: **error** + +## td_compatible_truncation + +**Parameter description**: Specifies whether to enable features compatible with a Teradata database. You can set this parameter to **on** when connecting to a database compatible with the TD database, so that when you perform the INSERT operation, overlong strings are truncated based on the allowed maximum length before being inserted into char- and varchar-type columns in the target table. This ensures all data is inserted into the target table without errors reported. + +> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **NOTE:** +> The string truncation function cannot be used if the INSERT statement includes a foreign table. +> If inserting multi-byte character data (such as Chinese characters) to database with the character set byte encoding (SQL_ASCII, LATIN1), and the character data crosses the truncation position, the string is truncated based on its bytes instead of characters. Unexpected result will occur in tail after the truncation. If you want correct truncation result, you are advised to adopt encoding set such as UTF8, which has no character data crossing the truncation position. + +This parameter is a USERSET parameter. Set it based on instructions provided in Table 2 [Methods for setting GUC parameters](../../../reference-guide/guc-parameters/appendix.md). + +**Value range**: Boolean + +- **on** indicates overlong strings are truncated. +- **off** indicates overlong strings are not truncated. + +**Default value**: **off** + +## lastval_supported + +**Parameter description**: Specifies whether to enable the **lastval** function. + +This parameter is a POSTMASTER parameter. Set it based on instructions provided in Table 1 [GUC parameters](../../../reference-guide/guc-parameters/appendix.md). + +**Value range**: Boolean + +- **on** indicates that the **lastval** function is supported. Additionally, the **nextval** function does not support push-down. +- **off** indicates that the **lastval** function is not supported. Additionally, the **nextval** function supports push-down. + +**Default value**: **off** diff --git a/product/en/docs-mogdb/v5.1/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md b/product/en/docs-mogdb/v5.1/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md index 2f131e75..758bee5a 100644 --- a/product/en/docs-mogdb/v5.1/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md +++ b/product/en/docs-mogdb/v5.1/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md @@ -132,7 +132,7 @@ This parameter is a USERSET parameter. Set it based on instructions provided in | bind_schema_tablespace | Binds a schema with the tablespace with the same name.
If a tablespace name is the same as *sche_name*, **default_tablespace** will also be set to *sche_name* if **search_path** is set to *sche_name*. | | bind_procedure_searchpath | Specifies the search path of the database object for which no schema name is specified.
If no schema name is specified for a stored procedure, the search is performed in the schema to which the stored procedure belongs.
If the stored procedure is not found, the following operations are performed:
- If this item is not specified, the system reports an error and exits.
- If this item is specified, the search continues based on the settings of **search_path**. If the issue persists, the system reports an error and exits. | | correct_to_number | Controls the compatibility of the to_number() result.
If this item is specified, the result of the to_number() function is the same as that of PG11. Otherwise, the result is the same as that of the O database. | -| unbind_dive_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | +| unbind_divide_bound | Controls the range check on the result of integer division.
If this item is specified, you do not need to check the range of the division result. For example, the result of INT_MIN/(-1) can be *INT_MAX*+1. If this item is not specified, an out-of-bounds error is reported because the result is greater than*INT_MAX*. | | return_null_string | Specifies how to display the empty result (empty string ") of the lpad() and rpad() functions.
- If this item is not specified, the empty string is displayed as **NULL**.
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- (1 row)`
- If this item is specified, the empty string is displayed as single quotation marks (").
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ---- 0 (1 row)` | | compat_concat_variadic | Specifies the compatibility of variadic results of the concat() and concat_ws() functions.
If this item is specified and a concat function has a parameter of the variadic type, different result formats in O and Teradata are retained. If this item is not specified and a concat function has a parameter of the variadic type, the result format of O is retained for both O and Teradata. This option has no effect on MY because MY has no variadic type. | | merge_update_multi | When MERGE INTO… WHEN MATCHED THEN UPDATE (see **MERGE INTO**) and INSERT… ON DUPLICATE KEY UPDATE (see **INSERT**) are used, control the UPDATE behavior if a piece of target data in the target table conflicts with multiple pieces of source data.
If this item is specified and the preceding scenario exists, the system performs multiple UPDATE operations on the conflicting row. If this item is not specified and the preceding scenario exists, an error is reported, that is, the MERGE or INSERT operation fails. | diff --git a/product/zh/docs-mogdb/v1.1/reference-guide/guc-parameters/24-miscellaneous-parameters.md b/product/zh/docs-mogdb/v1.1/reference-guide/guc-parameters/24-miscellaneous-parameters.md index 8ca06f7c..2185fadf 100644 --- a/product/zh/docs-mogdb/v1.1/reference-guide/guc-parameters/24-miscellaneous-parameters.md +++ b/product/zh/docs-mogdb/v1.1/reference-guide/guc-parameters/24-miscellaneous-parameters.md @@ -253,7 +253,7 @@ date: 2021-04-20 | bind_schema_tablespace | 绑定模式与同名表空间配置项。
如果存在与模式名sche_name相同的表空间名,那么如果设置search_path为sche_name, default_tablespace也会同步切换到sche_name。 | | bind_procedure_searchpath | 未指定模式名的数据库对象的搜索路径配置项。
在存储过程中如果不显示指定模式名,会优先在存储过程所属的模式下搜索。
如果找不到,则有两种情况:
- 若不设置此参数,报错退出。
- 若设置此参数,按照search_path中指定的顺序继续搜索。如果还是找不到,报错退出。 | | correct_to_number | 控制to_number()结果兼容性的配置项。
若设置此配置项,则to_number()函数结果与pg11保持一致,否则默认与O db保持一致。 | -| unbind_dive_bound | 控制对整数除法的结果进行范围校验。
若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 | +| unbind_divide_bound | 控制对整数除法的结果进行范围校验。
若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 | | merge_update_multi | 控制merge into匹配多行时是否进行update操作。
若设置此配置项,匹配多行时update不报错,否则默认与a db保持一致,报错。 | | return_null_string | 控制函数lpad()和rpad()结果为空字符串"的显示配置项。
- 不设置此配置项时,空字符串显示为NULL。
`postgres=# select length(lpad('123',0,'*')) from dual; length (1 row)`
- 设置此配置项时,空字符串显示为"。
`postgres=# select length(lpad('123',0,'*')) from dual; length 0 (1 row)` | | compat_concat_variadic | 控制函数concat()和concat_ws()对variadic类型结果兼容性的配置项。
若设置此配置项,当concat函数参数为variadic类型时,保留a db和Teradata兼容模式下不同的结果形式;否则默认a db和Teradata兼容模式下结果相同,且与a db保持一致。由于MY无variadic类型,所以该选项对MY无影响。 | diff --git a/product/zh/docs-mogdb/v2.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md b/product/zh/docs-mogdb/v2.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md index d3d84c64..fd69707b 100644 --- a/product/zh/docs-mogdb/v2.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md +++ b/product/zh/docs-mogdb/v2.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md @@ -118,7 +118,7 @@ date: 2021-04-20 | bind_schema_tablespace | 绑定模式与同名表空间配置项。
如果存在与模式名sche_name相同的表空间名,那么如果设置search_path为sche_name, default_tablespace也会同步切换到sche_name。 | | bind_procedure_searchpath | 未指定模式名的数据库对象的搜索路径配置项。
在存储过程中如果不显示指定模式名,会优先在存储过程所属的模式下搜索。
如果找不到,则有两种情况:
- 若不设置此参数,报错退出。
- 若设置此参数,按照search_path中指定的顺序继续搜索。如果还是找不到,报错退出。 | | correct_to_number | 控制to_number()结果兼容性的配置项。
若设置此配置项,则to_number()函数结果与pg11保持一致,否则默认与O db保持一致。 | -| unbind_dive_bound | 控制对整数除法的结果进行范围校验。
若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 | +| unbind_divide_bound | 控制对整数除法的结果进行范围校验。
若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 | | merge_update_multi | 控制merge into匹配多行时是否进行update操作。
若设置此配置项,匹配多行时update不报错,否则默认与a db保持一致,报错。 | | return_null_string | 控制函数lpad()和rpad()结果为空字符串”的显示配置项。
- 不设置此配置项时,空字符串显示为NULL。
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ----------------------- (1 row)*`
- 设置此配置项时,空字符串显示为”。
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ----------------------- 0 (1 row)` | | compat_concat_variadic | 控制函数concat()和concat_ws()对variadic类型结果兼容性的配置项。
若设置此配置项,当concat函数参数为variadic类型时,保留a db和Teradata兼容模式下不同的结果形式;否则默认a db和Teradata兼容模式下结果相同,且与a db保持一致。由于MY无variadic类型,所以该选项对MY无影响。 | diff --git a/product/zh/docs-mogdb/v2.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md b/product/zh/docs-mogdb/v2.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md index 8819645f..afac29c6 100644 --- a/product/zh/docs-mogdb/v2.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md +++ b/product/zh/docs-mogdb/v2.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md @@ -118,7 +118,7 @@ date: 2021-04-20 | bind_schema_tablespace | 绑定模式与同名表空间配置项。
如果存在与模式名sche_name相同的表空间名,那么如果设置search_path为sche_name, default_tablespace也会同步切换到sche_name。 | | bind_procedure_searchpath | 未指定模式名的数据库对象的搜索路径配置项。
在存储过程中如果不显示指定模式名,会优先在存储过程所属的模式下搜索。
如果找不到,则有两种情况:
- 若不设置此参数,报错退出。
- 若设置此参数,按照search_path中指定的顺序继续搜索。如果还是找不到,报错退出。 | | correct_to_number | 控制to_number()结果兼容性的配置项。
若设置此配置项,则to_number()函数结果与pg11保持一致,否则默认与O db保持一致。 | -| unbind_dive_bound | 控制对整数除法的结果进行范围校验。
若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 | +| unbind_divide_bound | 控制对整数除法的结果进行范围校验。
若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 | | merge_update_multi | 控制merge into匹配多行时是否进行update操作。
若设置此配置项,匹配多行时update不报错,否则默认与a db保持一致,报错。 | | return_null_string | 控制函数lpad()和rpad()结果为空字符串”的显示配置项。
- 不设置此配置项时,空字符串显示为NULL。
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ----------------------- (1 row)*`
- 设置此配置项时,空字符串显示为”。
`mogdb=# select length(lpad('123',0,'*')) from sys_dummy; length ----------------------- 0 (1 row)` | | compat_concat_variadic | 控制函数concat()和concat_ws()对variadic类型结果兼容性的配置项。
若设置此配置项,当concat函数参数为variadic类型时,保留a db和Teradata兼容模式下不同的结果形式;否则默认a db和Teradata兼容模式下结果相同,且与a db保持一致。由于MY无variadic类型,所以该选项对MY无影响。 | diff --git a/product/zh/docs-mogdb/v3.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md b/product/zh/docs-mogdb/v3.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md index ac0659e7..85bccf02 100644 --- a/product/zh/docs-mogdb/v3.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md +++ b/product/zh/docs-mogdb/v3.0/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md @@ -120,7 +120,7 @@ date: 2021-04-20 | bind_schema_tablespace | 绑定模式与同名表空间配置项。
如果存在与模式名sche_name相同的表空间名,那么如果设置search_path为sche_name, default_tablespace也会同步切换到sche_name。 | | bind_procedure_searchpath | 未指定模式名的数据库对象的搜索路径配置项。
在存储过程中如果不显示指定模式名,会优先在存储过程所属的模式下搜索。
如果找不到,则有两种情况:
- 若不设置此参数,报错退出。
- 若设置此参数,按照search_path中指定的顺序继续搜索。如果还是找不到,报错退出。 | | correct_to_number | 控制to_number()结果兼容性的配置项。
若设置此配置项,则to_number()函数结果与pg11保持一致,否则默认与O db保持一致。 | -| unbind_dive_bound | 控制对整数除法的结果进行范围校验。
若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 | +| unbind_divide_bound | 控制对整数除法的结果进行范围校验。
若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 | | return_null_string | 控制函数lpad()和rpad()结果为空字符串”的显示配置项。
- 不设置此配置项时,空字符串显示为NULL。
`MogDB=# select length(lpad('123',0,'*')) from sys_dummy; length ----------------------- (1 row)*`
- 设置此配置项时,空字符串显示为”。
`MogDB=# select length(lpad('123',0,'*')) from sys_dummy; length ----------------------- 0 (1 row)` | | compat_concat_variadic | 控制函数concat()和concat_ws()对variadic类型结果兼容性的配置项。
若设置此配置项,当concat函数参数为variadic类型时,保留a db和Teradata兼容模式下不同的结果形式;否则默认a db和Teradata兼容模式下结果相同,且与a db保持一致。由于MY无variadic类型,所以该选项对MY无影响。 | | merge_update_multi | 控制在使用MERGE INTO … WHEN MATCHED THEN UPDATE(参考[MERGE INTO](../../../reference-guide/sql-syntax/MERGE-INTO.md)) 和INSERT … ON DUPLICATE KEY UPDATE(参考[INSERT](../../../reference-guide/sql-syntax/INSERT.md))时,当目标表中一条目标数据与多条源数据冲突时UPDATE行为。
若设置此配置项,当存在上述场景时,该冲突行将会多次执行UPDATE;否则(默认)报错,即MERGE或INSERT操作失败。 | diff --git a/product/zh/docs-mogdb/v3.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md b/product/zh/docs-mogdb/v3.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md index ce6af1bf..1bf3e95c 100644 --- a/product/zh/docs-mogdb/v3.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md +++ b/product/zh/docs-mogdb/v3.1/reference-guide/guc-parameters/17-version-and-platform-compatibility/2-platform-and-client-compatibility.md @@ -131,7 +131,7 @@ date: 2021-04-20 | bind_schema_tablespace | 绑定模式与同名表空间配置项。
如果存在与模式名sche_name相同的表空间名,那么如果设置search_path为sche_name, default_tablespace也会同步切换到sche_name。 | | bind_procedure_searchpath | 未指定模式名的数据库对象的搜索路径配置项。
在存储过程中如果不显示指定模式名,会优先在存储过程所属的模式下搜索。
如果找不到,则有两种情况:
- 若不设置此参数,报错退出。
- 若设置此参数,按照search_path中指定的顺序继续搜索。如果还是找不到,报错退出。 | | correct_to_number | 控制to_number()结果兼容性的配置项。
若设置此配置项,则to_number()函数结果与pg11保持一致,否则默认与O db保持一致。 | -| unbind_dive_bound | 控制对整数除法的结果进行范围校验。
若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 | +| unbind_divide_bound | 控制对整数除法的结果进行范围校验。
若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 | | return_null_string | 控制函数lpad()和rpad()结果为空字符串”的显示配置项。
- 不设置此配置项时,空字符串显示为NULL。
`MogDB=# select length(lpad('123',0,'*')) from sys_dummy; length ----------------------- (1 row)*`
- 设置此配置项时,空字符串显示为”。
`MogDB=# select length(lpad('123',0,'*')) from sys_dummy; length ----------------------- 0 (1 row)` | | compat_concat_variadic | 控制函数concat()和concat_ws()对variadic类型结果兼容性的配置项。
若设置此配置项,当concat函数参数为variadic类型时,保留a db和Teradata兼容模式下不同的结果形式;否则默认a db和Teradata兼容模式下结果相同,且与a db保持一致。由于MY无variadic类型,所以该选项对MY无影响。 | | merge_update_multi | 控制在使用MERGE INTO … WHEN MATCHED THEN UPDATE(参考[MERGE INTO](../../../reference-guide/sql-syntax/MERGE-INTO.md)) 和INSERT … ON DUPLICATE KEY UPDATE(参考[INSERT](../../../reference-guide/sql-syntax/INSERT.md))时,当目标表中一条目标数据与多条源数据冲突时UPDATE行为。
若设置此配置项,当存在上述场景时,该冲突行将会多次执行UPDATE;否则(默认)报错,即MERGE或INSERT操作失败。 | diff --git a/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md b/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md index a1a1177b..0e8e141c 100644 --- a/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md +++ b/product/zh/docs-mogdb/v5.0/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md @@ -237,7 +237,7 @@ date: 2021-04-20 若设置此配置项,则to_number()函数结果与pg11保持一致,否则默认与Oracle保持一致。 -- unbind_dive_bound +- unbind_divide_bound 控制对整数除法的结果进行范围校验。 @@ -425,7 +425,7 @@ date: 2021-04-20 **参数说明**: 控制是否开启与Teradata数据库相应兼容的特征。该参数在用户连接上与TD兼容的数据库时,可以将参数设置成为on(即超长字符串自动截断功能启用),该功能启用后,在后续的insert语句中,对目标表中char和varchar类型的列插入超长字符串时,会按照目标表中相应列定义的最大长度对超长字符串进行自动截断。保证数据都能插入目标表中,而不是报错。 -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **说明**:超长字符串自动截断功能不适用于insert语句包含外表的场景。如果向字符集为字节类型编码(SQL_ASCII、LATIN1等)的数据库中插入多字节字符数据(如汉字等),且字符数据跨越截断位置,这种情况下,按照字节长度自动截断,自动截断后会在尾部产生非预期结果。如果用户有对于截断结果正确性的要求,建议用户采用UTF8等能够按照字符截断的输入字符集作为数据库的编码集。 +> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **说明**:超长字符串自动截断功能不适用于insert语句包含外表的场景。如果向字符集为字节类型编码(SQL_ASCII、LATIN1等)的数据库中插入多字节字符数据(如汉字等),且字符数据跨越截断位置,这种情况下,按照字节长度自动截断,自动截断后会在尾部产生非预期结果。如果用户有对于截断结果正确性的要求,建议用户采用UTF8等能够按照字符截断的输入字符集作为数据库的编码集。 该参数属于USERSET类型参数,请参考表[GUC参数分类](../../../reference-guide/guc-parameters/appendix.md)中对应设置方法进行设置。 diff --git a/product/zh/docs-mogdb/v5.1/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md b/product/zh/docs-mogdb/v5.1/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md index fb63256c..a5795a03 100644 --- a/product/zh/docs-mogdb/v5.1/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md +++ b/product/zh/docs-mogdb/v5.1/reference-guide/guc-parameters/version-and-platform-compatibility/platform-and-client-compatibility.md @@ -239,7 +239,7 @@ date: 2021-04-20 若设置此配置项,则to_number()函数结果与pg11保持一致,否则默认与Oracle保持一致。 -- unbind_dive_bound +- unbind_divide_bound 控制对整数除法的结果进行范围校验。 -- Gitee