diff --git a/product/en/docs-mogdb/v3.0/_index.md b/product/en/docs-mogdb/v3.0/_index.md index 742d137d00e516cbbb922a394f5d6ba73aa026f6..0cf422dcbb24f470fd44dad51a6128592caa259b 100644 --- a/product/en/docs-mogdb/v3.0/_index.md +++ b/product/en/docs-mogdb/v3.0/_index.md @@ -73,7 +73,7 @@ date: 2022-08-07 -[PTK - Provisioning Toolkit](../../docs-ptk/v1.0/overview.md) +[PTK - Provisioning Toolkit](../../docs-ptk/v1.1/overview.md) [MTK - Database Migration Toolkit](../../docs-mtk/v2.0/overview.md) diff --git a/product/en/docs-mogdb/v3.0/characteristic-description/high-availability/12-parallel-logical-decoding.md b/product/en/docs-mogdb/v3.0/characteristic-description/high-availability/12-parallel-logical-decoding.md index 72818912277c909e8224324a3c7e6ba051b00c6e..41257ad1f802bfb54a1497f1ce04fe4d420574a6 100644 --- a/product/en/docs-mogdb/v3.0/characteristic-description/high-availability/12-parallel-logical-decoding.md +++ b/product/en/docs-mogdb/v3.0/characteristic-description/high-availability/12-parallel-logical-decoding.md @@ -35,19 +35,14 @@ None. 4. The value of the decoding configuration option **parallel-decode-num** is greater than 1 and less than or equal to 20, specifying the number of concurrent decoding threads. 5. Decoding into DDL statements is not supported. 6. Decoding is not supported for column-store data and data page replication. -7. Distributed transactions cannot be decoded. Currently, decoding is performed by DN, which cannot ensure consistency in distributed transaction decoding. -8. The size of a single tuple cannot exceed 1 GB. Decoding results may be larger than inserted data. Therefore, it is recommended that the size of a single tuple be less than or equal to 500 MB. -9. Decoding compressed tables into DML statements is not supported. -10. MogDB supports the following data types for decoding: **INTEGER**, **BIGINT**, **SMALLILNT**, **TINYINT**, **SERIAL**, **SMALLSERIAL**, **BIGSERIAL**, **FLOAT**, **DOUBLE PRECISION**, **DATE**, **TIME[WITHOUT TIME ZONE]**, **TIMESTAMP[WITHOUT TIME ZONE]**, **CHAR(***n***)**, **VARCHAR(***n***)**, and **TEXT**. -11. If the SSL connection is required, the GUC parameter **ssl** must be set to **on**. -12. Interval partitioned tables cannot be replicated. -13. After a DDL statement is executed in a transaction, the DDL statement and subsequent statements are not decoded. -14. To perform decoding on the standby node, set the GUC parameter **enable_slot_log** to **on** on the corresponding host. -15. Currently, ultra-large CLOB decoding is not supported. -16. The same replication slot for decoding cannot be used between the primary node and standby node or between different standby nodes at the same time. Otherwise, data inconsistency will occur. -17. Do not perform operations on the replication slot on other nodes when the logical replication slot is in use. To delete a replication slot, stop decoding in the replication slot first. -18. Only the built-in 'j' style export is supported, and the wal2json extension is not supported. - -## Dependencies - -Decoding is performed on the standby node. \ No newline at end of file +7. The size of a single tuple cannot exceed 1 GB. Decoding results may be larger than inserted data. Therefore, it is recommended that the size of a single tuple be less than or equal to 500 MB. +8. Decoding compressed tables into DML statements is not supported. +9. MogDB supports the following data types for decoding: **INTEGER**, **BIGINT**, **SMALLILNT**, **TINYINT**, **SERIAL**, **SMALLSERIAL**, **BIGSERIAL**, **FLOAT**, **DOUBLE PRECISION**, **DATE**, **TIME[WITHOUT TIME ZONE]**, **TIMESTAMP[WITHOUT TIME ZONE]**, **CHAR(***n***)**, **VARCHAR(***n***)**, and **TEXT**. +10. If the SSL connection is required, the GUC parameter **ssl** must be set to **on**. +11. Interval partitioned tables cannot be replicated. +12. After a DDL statement is executed in a transaction, the DDL statement and subsequent statements are not decoded. +13. To perform decoding on the standby node, set the GUC parameter **enable_slot_log** to **on** on the corresponding host. +14. Currently, ultra-large CLOB decoding is not supported. +15. The same replication slot for decoding cannot be used between the primary node and standby node or between different standby nodes at the same time. Otherwise, data inconsistency will occur. +16. Do not perform operations on the replication slot on other nodes when the logical replication slot is in use. To delete a replication slot, stop decoding in the replication slot first. +17. Only the built-in 'j' style export is supported, and the wal2json extension is not supported. diff --git a/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/unified-database-management-tool.md b/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/unified-database-management-tool.md index baef87e022073057e391a940cf74fe0f70bc0e47..f7b31057844923aa0161fbab5d7952071a003dfe 100644 --- a/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/unified-database-management-tool.md +++ b/product/en/docs-mogdb/v3.0/reference-guide/tool-reference/unified-database-management-tool.md @@ -1028,7 +1028,7 @@ Files related to the **cm_ctl** tool: - chmod 400 client.key.cipher - chmod 400 client.key.rand -3. The certificate validity period is checked every day, which can be set through **ssl_cert_expire_check_interval**. An alarm is generated when the certificate is about to expire in 90 days, which can be set through **ssl_cert_expire_alert_threshold**. (For details about the parameter, see [ssl_cert_expire_alert_threshold](../../reference-guide/guc-parameters/cm-parameters/cm_server.md#ssl_cert_expire_alert_threshold).) +3. The certificate validity period is checked every day, which can be set through **ssl_cert_expire_check_interval**. An alarm is generated when the certificate is about to expire in 90 days, which can be set through **ssl_cert_expire_alert_threshold**. (For details about the parameter, see [ssl_cert_expire_alert_threshold](#ssl_cert_expire_alert_threshold).) ## CM Parameters diff --git a/product/en/docs-mogdb/v3.1/_index.md b/product/en/docs-mogdb/v3.1/_index.md index 742d137d00e516cbbb922a394f5d6ba73aa026f6..0cf422dcbb24f470fd44dad51a6128592caa259b 100644 --- a/product/en/docs-mogdb/v3.1/_index.md +++ b/product/en/docs-mogdb/v3.1/_index.md @@ -73,7 +73,7 @@ date: 2022-08-07 -[PTK - Provisioning Toolkit](../../docs-ptk/v1.0/overview.md) +[PTK - Provisioning Toolkit](../../docs-ptk/v1.1/overview.md) [MTK - Database Migration Toolkit](../../docs-mtk/v2.0/overview.md) diff --git a/product/en/docs-mogdb/v5.0/_index.md b/product/en/docs-mogdb/v5.0/_index.md index 829fb7c4615fd97158ae97d79a510e014f67e00a..fb54a9c9a771e39c9392649dc7de02be9b21efd0 100644 --- a/product/en/docs-mogdb/v5.0/_index.md +++ b/product/en/docs-mogdb/v5.0/_index.md @@ -73,7 +73,7 @@ date: 2022-08-07 -[PTK - Provisioning Toolkit](../../docs-ptk/v1.0/overview.md) +[PTK - Provisioning Toolkit](../../docs-ptk/v1.1/overview.md) [MTK - Database Migration Toolkit](../../docs-mtk/v2.0/overview.md) diff --git a/product/en/docs-mogdb/v5.0/characteristic-description/high-availability/12-parallel-logical-decoding.md b/product/en/docs-mogdb/v5.0/characteristic-description/high-availability/12-parallel-logical-decoding.md index a90641116e5e01cd2b7f619c10e82d32e545173d..544ae34be1c9b28a8282d92f14952165d47df83a 100644 --- a/product/en/docs-mogdb/v5.0/characteristic-description/high-availability/12-parallel-logical-decoding.md +++ b/product/en/docs-mogdb/v5.0/characteristic-description/high-availability/12-parallel-logical-decoding.md @@ -1,57 +1,52 @@ ---- -title: Parallel Logical Decoding -summary: Parallel Logical Decoding -author: Guo Huan -date: 2022-05-10 ---- - -# Parallel Logical Decoding - -## Availability - -This feature is available since MogDB 3.0.0. - -## Introduction - -Multi-thread parallel decoding is supported. - -## Benefits - -The logical decoding performance is greatly improved and the decoding speed can be improved from 3 to 5 Mbit/s to 100 Mbit/s in standard scenarios (16-core CPU, 128 GB memory, network bandwidth > 200 Mbit/s, 10 to 100 columns in a table, 0.1 KB to 1 KB data volume in a single row, insert as the main DML operation, no flush transaction is involved, that is, number of statements in a single transaction < 4096). - -## Description - -When JDBC or pg_recvlogical is used for decoding, you can set **parallel-decode-num** to a value greater than 1 and less than or equal to 20 to enable parallel decoding. In this way, one read thread, multiple decoding threads, and one sending thread are used to perform logical decoding, significantly improving the decoding speed. - -## Enhancements - -None. - -## Constraints - -1. The hardware and network environment must be normal. The size of a logical log is twice that of an Xlog. To ensure that the speed of the Xlog reaches 100 Mbit/s, the I/O bandwidth must be at least 200 Mbit/s. Resources need to be reserved for the reader, decoder, and sender threads. The number of CPU cores to be reserved must be the number of concurrent threads plus 2. For example, if there are four concurrent threads, six CPU cores need to be reserved. In actual scenarios, decoding on the standby node can meet the requirements, and no special resource reservation planning is required. To ensure that the decoding performance meets the requirements and minimize the impact on services, you are advised to set up only one parallel decoding connection on a standby node to ensure that the CPU, memory, and bandwidth resources are sufficient. -2. The value of GUC parameter **wal_level** of the log level is **logical**. -3. The GUC parameter **max_replication_slots** is set to a value greater than or equal to the number of physical streaming replication slots, backup slots, and logical replication slots required by each DN. -4. The value of the decoding configuration option **parallel-decode-num** is greater than 1 and less than or equal to 20, specifying the number of concurrent decoding threads. -5. Decoding into DDL statements is not supported. -6. Decoding is not supported for column-store data and data page replication. -7. Distributed transactions cannot be decoded. Currently, decoding is performed by DN, which cannot ensure consistency in distributed transaction decoding. -8. The size of a single tuple cannot exceed 1 GB. Decoding results may be larger than inserted data. Therefore, it is recommended that the size of a single tuple be less than or equal to 500 MB. -9. Decoding compressed tables into DML statements is not supported. -10. MogDB supports the following data types for decoding: **INTEGER**, **BIGINT**, **SMALLILNT**, **TINYINT**, **SERIAL**, **SMALLSERIAL**, **BIGSERIAL**, **FLOAT**, **DOUBLE PRECISION**, **DATE**, **TIME[WITHOUT TIME ZONE]**, **TIMESTAMP[WITHOUT TIME ZONE]**, **CHAR(***n***)**, **VARCHAR(***n***)**, and **TEXT**. -11. If the SSL connection is required, the GUC parameter **ssl** must be set to **on**. -12. Interval partitioned tables cannot be replicated. -13. After a DDL statement is executed in a transaction, the DDL statement and subsequent statements are not decoded. -14. To perform decoding on the standby node, set the GUC parameter **enable_slot_log** to **on** on the corresponding host. -15. Currently, ultra-large CLOB decoding is not supported. -16. The same replication slot for decoding cannot be used between the primary node and standby node or between different standby nodes at the same time. Otherwise, data inconsistency will occur. -17. Do not perform operations on the replication slot on other nodes when the logical replication slot is in use. To delete a replication slot, stop decoding in the replication slot first. -18. Only the built-in 'j' style export is supported, and the wal2json extension is not supported. - -## Dependencies - -Decoding is performed on the standby node. - -## Related Pages - +--- +title: Parallel Logical Decoding +summary: Parallel Logical Decoding +author: Guo Huan +date: 2022-05-10 +--- + +# Parallel Logical Decoding + +## Availability + +This feature is available since MogDB 3.0.0. + +## Introduction + +Multi-thread parallel decoding is supported. + +## Benefits + +The logical decoding performance is greatly improved and the decoding speed can be improved from 3 to 5 Mbit/s to 100 Mbit/s in standard scenarios (16-core CPU, 128 GB memory, network bandwidth > 200 Mbit/s, 10 to 100 columns in a table, 0.1 KB to 1 KB data volume in a single row, insert as the main DML operation, no flush transaction is involved, that is, number of statements in a single transaction < 4096). + +## Description + +When JDBC or pg_recvlogical is used for decoding, you can set **parallel-decode-num** to a value greater than 1 and less than or equal to 20 to enable parallel decoding. In this way, one read thread, multiple decoding threads, and one sending thread are used to perform logical decoding, significantly improving the decoding speed. + +## Enhancements + +None. + +## Constraints + +1. The hardware and network environment must be normal. The size of a logical log is twice that of an Xlog. To ensure that the speed of the Xlog reaches 100 Mbit/s, the I/O bandwidth must be at least 200 Mbit/s. Resources need to be reserved for the reader, decoder, and sender threads. The number of CPU cores to be reserved must be the number of concurrent threads plus 2. For example, if there are four concurrent threads, six CPU cores need to be reserved. In actual scenarios, decoding on the standby node can meet the requirements, and no special resource reservation planning is required. To ensure that the decoding performance meets the requirements and minimize the impact on services, you are advised to set up only one parallel decoding connection on a standby node to ensure that the CPU, memory, and bandwidth resources are sufficient. +2. The value of GUC parameter **wal_level** of the log level is **logical**. +3. The GUC parameter **max_replication_slots** is set to a value greater than or equal to the number of physical streaming replication slots, backup slots, and logical replication slots required by each DN. +4. The value of the decoding configuration option **parallel-decode-num** is greater than 1 and less than or equal to 20, specifying the number of concurrent decoding threads. +5. Decoding into DDL statements is not supported. +6. Decoding is not supported for column-store data and data page replication. +7. The size of a single tuple cannot exceed 1 GB. Decoding results may be larger than inserted data. Therefore, it is recommended that the size of a single tuple be less than or equal to 500 MB. +8. Decoding compressed tables into DML statements is not supported. +9. MogDB supports the following data types for decoding: **INTEGER**, **BIGINT**, **SMALLILNT**, **TINYINT**, **SERIAL**, **SMALLSERIAL**, **BIGSERIAL**, **FLOAT**, **DOUBLE PRECISION**, **DATE**, **TIME[WITHOUT TIME ZONE]**, **TIMESTAMP[WITHOUT TIME ZONE]**, **CHAR(***n***)**, **VARCHAR(***n***)**, and **TEXT**. +10. If the SSL connection is required, the GUC parameter **ssl** must be set to **on**. +11. Interval partitioned tables cannot be replicated. +12. After a DDL statement is executed in a transaction, the DDL statement and subsequent statements are not decoded. +13. To perform decoding on the standby node, set the GUC parameter **enable_slot_log** to **on** on the corresponding host. +14. Currently, ultra-large CLOB decoding is not supported. +15. The same replication slot for decoding cannot be used between the primary node and standby node or between different standby nodes at the same time. Otherwise, data inconsistency will occur. +16. Do not perform operations on the replication slot on other nodes when the logical replication slot is in use. To delete a replication slot, stop decoding in the replication slot first. +17. Only the built-in 'j' style export is supported, and the wal2json extension is not supported. + +## Related Pages + [Example Logic Replication Code](../../developer-guide/dev/2-development-based-on-jdbc/14-example-logic-replication-code.md) \ No newline at end of file diff --git a/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/safety-design.md b/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/safety-design.md index 5b36949c26dd290b67abdd82be2eff2a5493def4..eb3bf459ca31cdb7a7ee51e0dfa302cf45ea6191 100644 --- a/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/safety-design.md +++ b/product/en/docs-mogdb/v5.0/reference-guide/tool-reference/cluster-management/safety-design.md @@ -57,4 +57,4 @@ date: 2022-11-11 - chmod 400 client.key.cipher - chmod 400 client.key.rand -3. The certificate validity period is checked every day, which can be set through **ssl_cert_expire_check_interval**. An alarm is generated when the certificate is about to expire in 90 days, which can be set through **ssl_cert_expire_alert_threshold**. (For details about the parameter, see [ssl_cert_expire_alert_threshold](../../../reference-guide/guc-parameters/cm-parameters/cm_server.md#ssl_cert_expire_alert_threshold).) \ No newline at end of file +3. The certificate validity period is checked every day, which can be set through **ssl_cert_expire_check_interval**. An alarm is generated when the certificate is about to expire in 90 days, which can be set through **ssl_cert_expire_alert_threshold**. (For details about the parameter, see [ssl_cert_expire_alert_threshold](./cm-configuration-parameter/cm-cm_server.md#ssl_cert_expire_alert_threshold).) \ No newline at end of file diff --git a/product/en/docs-mogdb/v5.1/_index.md b/product/en/docs-mogdb/v5.1/_index.md index 829fb7c4615fd97158ae97d79a510e014f67e00a..fb54a9c9a771e39c9392649dc7de02be9b21efd0 100644 --- a/product/en/docs-mogdb/v5.1/_index.md +++ b/product/en/docs-mogdb/v5.1/_index.md @@ -73,7 +73,7 @@ date: 2022-08-07 -[PTK - Provisioning Toolkit](../../docs-ptk/v1.0/overview.md) +[PTK - Provisioning Toolkit](../../docs-ptk/v1.1/overview.md) [MTK - Database Migration Toolkit](../../docs-mtk/v2.0/overview.md) diff --git a/product/en/docs-mogdb/v5.1/characteristic-description/high-availability/12-parallel-logical-decoding.md b/product/en/docs-mogdb/v5.1/characteristic-description/high-availability/12-parallel-logical-decoding.md index 995230b8e0eaf879a054f355217d463b42d7b208..544ae34be1c9b28a8282d92f14952165d47df83a 100644 --- a/product/en/docs-mogdb/v5.1/characteristic-description/high-availability/12-parallel-logical-decoding.md +++ b/product/en/docs-mogdb/v5.1/characteristic-description/high-availability/12-parallel-logical-decoding.md @@ -35,22 +35,17 @@ None. 4. The value of the decoding configuration option **parallel-decode-num** is greater than 1 and less than or equal to 20, specifying the number of concurrent decoding threads. 5. Decoding into DDL statements is not supported. 6. Decoding is not supported for column-store data and data page replication. -7. Distributed transactions cannot be decoded. Currently, decoding is performed by DN, which cannot ensure consistency in distributed transaction decoding. -8. The size of a single tuple cannot exceed 1 GB. Decoding results may be larger than inserted data. Therefore, it is recommended that the size of a single tuple be less than or equal to 500 MB. -9. Decoding compressed tables into DML statements is not supported. -10. MogDB supports the following data types for decoding: **INTEGER**, **BIGINT**, **SMALLILNT**, **TINYINT**, **SERIAL**, **SMALLSERIAL**, **BIGSERIAL**, **FLOAT**, **DOUBLE PRECISION**, **DATE**, **TIME[WITHOUT TIME ZONE]**, **TIMESTAMP[WITHOUT TIME ZONE]**, **CHAR(***n***)**, **VARCHAR(***n***)**, and **TEXT**. -11. If the SSL connection is required, the GUC parameter **ssl** must be set to **on**. -12. Interval partitioned tables cannot be replicated. -13. After a DDL statement is executed in a transaction, the DDL statement and subsequent statements are not decoded. -14. To perform decoding on the standby node, set the GUC parameter **enable_slot_log** to **on** on the corresponding host. -15. Currently, ultra-large CLOB decoding is not supported. -16. The same replication slot for decoding cannot be used between the primary node and standby node or between different standby nodes at the same time. Otherwise, data inconsistency will occur. -17. Do not perform operations on the replication slot on other nodes when the logical replication slot is in use. To delete a replication slot, stop decoding in the replication slot first. -18. Only the built-in 'j' style export is supported, and the wal2json extension is not supported. - -## Dependencies - -Decoding is performed on the standby node. +7. The size of a single tuple cannot exceed 1 GB. Decoding results may be larger than inserted data. Therefore, it is recommended that the size of a single tuple be less than or equal to 500 MB. +8. Decoding compressed tables into DML statements is not supported. +9. MogDB supports the following data types for decoding: **INTEGER**, **BIGINT**, **SMALLILNT**, **TINYINT**, **SERIAL**, **SMALLSERIAL**, **BIGSERIAL**, **FLOAT**, **DOUBLE PRECISION**, **DATE**, **TIME[WITHOUT TIME ZONE]**, **TIMESTAMP[WITHOUT TIME ZONE]**, **CHAR(***n***)**, **VARCHAR(***n***)**, and **TEXT**. +10. If the SSL connection is required, the GUC parameter **ssl** must be set to **on**. +11. Interval partitioned tables cannot be replicated. +12. After a DDL statement is executed in a transaction, the DDL statement and subsequent statements are not decoded. +13. To perform decoding on the standby node, set the GUC parameter **enable_slot_log** to **on** on the corresponding host. +14. Currently, ultra-large CLOB decoding is not supported. +15. The same replication slot for decoding cannot be used between the primary node and standby node or between different standby nodes at the same time. Otherwise, data inconsistency will occur. +16. Do not perform operations on the replication slot on other nodes when the logical replication slot is in use. To delete a replication slot, stop decoding in the replication slot first. +17. Only the built-in 'j' style export is supported, and the wal2json extension is not supported. ## Related Pages diff --git a/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/safety-design.md b/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/safety-design.md index 5b36949c26dd290b67abdd82be2eff2a5493def4..eb3bf459ca31cdb7a7ee51e0dfa302cf45ea6191 100644 --- a/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/safety-design.md +++ b/product/en/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/safety-design.md @@ -57,4 +57,4 @@ date: 2022-11-11 - chmod 400 client.key.cipher - chmod 400 client.key.rand -3. The certificate validity period is checked every day, which can be set through **ssl_cert_expire_check_interval**. An alarm is generated when the certificate is about to expire in 90 days, which can be set through **ssl_cert_expire_alert_threshold**. (For details about the parameter, see [ssl_cert_expire_alert_threshold](../../../reference-guide/guc-parameters/cm-parameters/cm_server.md#ssl_cert_expire_alert_threshold).) \ No newline at end of file +3. The certificate validity period is checked every day, which can be set through **ssl_cert_expire_check_interval**. An alarm is generated when the certificate is about to expire in 90 days, which can be set through **ssl_cert_expire_alert_threshold**. (For details about the parameter, see [ssl_cert_expire_alert_threshold](./cm-configuration-parameter/cm-cm_server.md#ssl_cert_expire_alert_threshold).) \ No newline at end of file diff --git a/product/zh/docs-mogdb/v3.0/_index.md b/product/zh/docs-mogdb/v3.0/_index.md index 320eda54d401b1ea9914ed23a95058b688229808..699ab9ce85434eb66fce93b9907d575b5e5ca47c 100644 --- a/product/zh/docs-mogdb/v3.0/_index.md +++ b/product/zh/docs-mogdb/v3.0/_index.md @@ -73,7 +73,7 @@ date: 2022-08-07 -[PTK部署运维工具](../../docs-ptk/v1.0/overview.md) +[PTK部署运维工具](../../docs-ptk/v1.1/overview.md) [MTK异构数据库迁移](../../docs-mtk/v2.0/overview.md) diff --git a/product/zh/docs-mogdb/v3.0/characteristic-description/high-availability/12-parallel-logical-decoding.md b/product/zh/docs-mogdb/v3.0/characteristic-description/high-availability/12-parallel-logical-decoding.md index 934b73cd560788afae6a4bf4be72baa00b9171f3..6319fe9f81c22e54edbee06f51eff4b3f2b2950d 100644 --- a/product/zh/docs-mogdb/v3.0/characteristic-description/high-availability/12-parallel-logical-decoding.md +++ b/product/zh/docs-mogdb/v3.0/characteristic-description/high-availability/12-parallel-logical-decoding.md @@ -35,19 +35,14 @@ date: 2022-05-10 4. 解码配置选项parallel-decode-num > 1且<= 20,指定并行的解码线程数。 5. 不支持DDL语句解码。 6. 不支持列存、数据页复制的解码。 -7. 不支持解码分布式事务,当前机制为从DN解码,无法保证分布式事务一致性解码。 -8. 单条元组大小不超过1GB,考虑解码结果可能大于插入数据,因此建议单条元组大小不超过500MB。 -9. 不支持压缩表的DML语句解码。 -10. MogDB支持解码的数据类型为:INTEGER、BIGINT、SMALLILNT、TINYINT、SERIAL、SMALLSERIAL、BIGSERIAL、FLOAT、DOUBLE PRECISION、DATE、TIME[WITHOUT TIME ZONE]、TIMESTAMP[WITHOUT TIME ZONE]、CHAR(n)、VARCHAR(n)、TEXT。 -11. 在需要ssl连接的场景,需要前置条件保证guc参数ssl = on。 -12. 不支持interval partition表复制。 -13. 在事务中执行DDL语句后,该DDL语句与之后的语句不会被解码。 -14. 如需进行备机解码,需在对应主机上设置guc参数enable_slot_log = on。 -15. 当前不支持超大CLOB解码。 -16. 不允许主备,多个备机同时使用同一个复制槽解码,否则会产生数据不一致。 -17. 禁止在使用逻辑复制槽时在其他节点对该复制槽进行操作,删除复制槽的操作需在该复制槽停止解码后执行。 -18. 仅支持内置'j'风格导出,不支持wal2json插件。 - -## 依赖关系 - -依赖备机解码。 \ No newline at end of file +7. 单条元组大小不超过1GB,考虑解码结果可能大于插入数据,因此建议单条元组大小不超过500MB。 +8. 不支持压缩表的DML语句解码。 +9. MogDB支持解码的数据类型为:INTEGER、BIGINT、SMALLILNT、TINYINT、SERIAL、SMALLSERIAL、BIGSERIAL、FLOAT、DOUBLE PRECISION、DATE、TIME[WITHOUT TIME ZONE]、TIMESTAMP[WITHOUT TIME ZONE]、CHAR(n)、VARCHAR(n)、TEXT。 +10. 在需要ssl连接的场景,需要前置条件保证guc参数ssl = on。 +11. 不支持interval partition表复制。 +12. 在事务中执行DDL语句后,该DDL语句与之后的语句不会被解码。 +13. 如需进行备机解码,需在对应主机上设置guc参数enable_slot_log = on。 +14. 当前不支持超大CLOB解码。 +15. 不允许主备,多个备机同时使用同一个复制槽解码,否则会产生数据不一致。 +16. 禁止在使用逻辑复制槽时在其他节点对该复制槽进行操作,删除复制槽的操作需在该复制槽停止解码后执行。 +17. 仅支持内置'j'风格导出,不支持wal2json插件。 diff --git a/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/unified-database-management-tool.md b/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/unified-database-management-tool.md index 70fe390ca3ca2310cb550008d06a2f2313a0bb61..fcb9b87c8cf581f31e0a8ae9538ed47c15a45aa1 100644 --- a/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/unified-database-management-tool.md +++ b/product/zh/docs-mogdb/v3.0/reference-guide/tool-reference/unified-database-management-tool.md @@ -488,7 +488,7 @@ cm_ctl encrypt [-M MODE] -D DATADIR - chmod 400 client.key.cipher - chmod 400 client.key.rand -证书有效期的检测周期为1天,可通过ssl_cert_expire_check_interval设置。证书有效期剩余90天时会开始产生告警,可通过[ssl_cert_expire_alert_threshold](../../reference-guide/guc-parameters/cm-parameters/cm_server.md#ssl_cert_expire_alert_threshold)设置。 +证书有效期的检测周期为1天,可通过ssl_cert_expire_check_interval设置。证书有效期剩余90天时会开始产生告警,可通过[ssl_cert_expire_alert_threshold](#ssl_cert_expire_alert_threshold)设置。 ## CM配置参数介绍 diff --git a/product/zh/docs-mogdb/v3.1/_index.md b/product/zh/docs-mogdb/v3.1/_index.md index 320eda54d401b1ea9914ed23a95058b688229808..699ab9ce85434eb66fce93b9907d575b5e5ca47c 100644 --- a/product/zh/docs-mogdb/v3.1/_index.md +++ b/product/zh/docs-mogdb/v3.1/_index.md @@ -73,7 +73,7 @@ date: 2022-08-07 -[PTK部署运维工具](../../docs-ptk/v1.0/overview.md) +[PTK部署运维工具](../../docs-ptk/v1.1/overview.md) [MTK异构数据库迁移](../../docs-mtk/v2.0/overview.md) diff --git a/product/zh/docs-mogdb/v5.0/_index.md b/product/zh/docs-mogdb/v5.0/_index.md index 03a8ff827be586565613614bdd3d80dbabdd26de..97eda78901565f63776d9ca7c886bde05f1facad 100644 --- a/product/zh/docs-mogdb/v5.0/_index.md +++ b/product/zh/docs-mogdb/v5.0/_index.md @@ -73,7 +73,7 @@ date: 2022-08-07 -[PTK部署运维工具](../../docs-ptk/v1.0/overview.md) +[PTK部署运维工具](../../docs-ptk/v1.1/overview.md) [MTK异构数据库迁移](../../docs-mtk/v2.0/overview.md) diff --git a/product/zh/docs-mogdb/v5.0/characteristic-description/characteristic-description-overview.md b/product/zh/docs-mogdb/v5.0/characteristic-description/characteristic-description-overview.md index c1f6a0e9dff8172b0ada28bc5021c01ca28a957d..100694b3c0bc1aad4b3b7571ca36ad2ed8e9cc59 100644 --- a/product/zh/docs-mogdb/v5.0/characteristic-description/characteristic-description-overview.md +++ b/product/zh/docs-mogdb/v5.0/characteristic-description/characteristic-description-overview.md @@ -83,7 +83,7 @@ MogDB 5.0版本具有以下特性: + [支持PLPGSQL subtype](./compatibility/support-plpgsql-subtype.md) + [支持无参数FUNCTION的同义词调用不加括号](./compatibility/support-synonym-calls-without-parentheses-for-function-without-parameters.md) + [支持dbms_utility.format_error_backtrace](./compatibility/format-error-backtrace.md) - + [支持PIVOT和UNPIVOT语法](pivot-and-unpivot.md) + + [支持PIVOT和UNPIVOT语法](./compatibility/pivot-and-unpivot.md) + 数据库安全 + [访问控制模型](./database-security/1-access-control-model.md) + [控制权和访问权分离](./database-security/2-separation-of-control-and-access-permissions.md) diff --git a/product/zh/docs-mogdb/v5.0/characteristic-description/high-availability/12-parallel-logical-decoding.md b/product/zh/docs-mogdb/v5.0/characteristic-description/high-availability/12-parallel-logical-decoding.md index 98567f073e5986451a6e8b397e5a99147763f0da..e6145984c60c0f1c55e4e325b0965a7a8e08f9b8 100644 --- a/product/zh/docs-mogdb/v5.0/characteristic-description/high-availability/12-parallel-logical-decoding.md +++ b/product/zh/docs-mogdb/v5.0/characteristic-description/high-availability/12-parallel-logical-decoding.md @@ -35,22 +35,17 @@ date: 2022-05-10 4. 解码配置选项parallel-decode-num > 1且<= 20,指定并行的解码线程数。 5. 不支持DDL语句解码。 6. 不支持列存、数据页复制的解码。 -7. 不支持解码分布式事务,当前机制为从DN解码,无法保证分布式事务一致性解码。 -8. 单条元组大小不超过1GB,考虑解码结果可能大于插入数据,因此建议单条元组大小不超过500MB。 -9. 不支持压缩表的DML语句解码。 -10. MogDB支持解码的数据类型为:INTEGER、BIGINT、SMALLILNT、TINYINT、SERIAL、SMALLSERIAL、BIGSERIAL、FLOAT、DOUBLE PRECISION、DATE、TIME[WITHOUT TIME ZONE]、TIMESTAMP[WITHOUT TIME ZONE]、CHAR(n)、VARCHAR(n)、TEXT。 -11. 在需要ssl连接的场景,需要前置条件保证guc参数ssl = on。 -12. 不支持interval partition表复制。 -13. 在事务中执行DDL语句后,该DDL语句与之后的语句不会被解码。 -14. 如需进行备机解码,需在对应主机上设置guc参数enable_slot_log = on。 -15. 当前不支持超大CLOB解码。 -16. 不允许主备,多个备机同时使用同一个复制槽解码,否则会产生数据不一致。 -17. 禁止在使用逻辑复制槽时在其他节点对该复制槽进行操作,删除复制槽的操作需在该复制槽停止解码后执行。 -18. 仅支持内置'j'风格导出,不支持wal2json插件。 - -## 依赖关系 - -依赖备机解码。 +7. 单条元组大小不超过1GB,考虑解码结果可能大于插入数据,因此建议单条元组大小不超过500MB。 +8. 不支持压缩表的DML语句解码。 +9. MogDB支持解码的数据类型为:INTEGER、BIGINT、SMALLILNT、TINYINT、SERIAL、SMALLSERIAL、BIGSERIAL、FLOAT、DOUBLE PRECISION、DATE、TIME[WITHOUT TIME ZONE]、TIMESTAMP[WITHOUT TIME ZONE]、CHAR(n)、VARCHAR(n)、TEXT。 +10. 在需要ssl连接的场景,需要前置条件保证guc参数ssl = on。 +11. 不支持interval partition表复制。 +12. 在事务中执行DDL语句后,该DDL语句与之后的语句不会被解码。 +13. 如需进行备机解码,需在对应主机上设置guc参数enable_slot_log = on。 +14. 当前不支持超大CLOB解码。 +15. 不允许主备,多个备机同时使用同一个复制槽解码,否则会产生数据不一致。 +16. 禁止在使用逻辑复制槽时在其他节点对该复制槽进行操作,删除复制槽的操作需在该复制槽停止解码后执行。 +17. 仅支持内置'j'风格导出,不支持wal2json插件。 ## 相关页面 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 7809a986c053a9ccf24dfed072180063f62ee524..a1a1177bfab315e50af545540c7a09b6dc6c1eef 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 @@ -144,75 +144,297 @@ date: 2021-04-20 ## behavior_compat_options -**参数说明**: 数据库兼容性行为配置项,该参数的值由若干个配置项用逗号隔开构成。 +**参数说明**:数据库兼容性行为配置项,该参数的值由若干个配置项用逗号隔开构成。 该参数属于USERSET类型参数,请参考表[GUC参数分类](../../../reference-guide/guc-parameters/appendix.md)中对应设置方法进行设置。 -**取值范围**: 字符串 +**取值范围**:字符串 -**默认值**: 空 +**默认值**:空 -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **说明**: +> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **说明**: > -> - 当前只支持[表1](#jianrongxing)。 > - 配置多个兼容性配置项时,相邻配置项用逗号隔开,例如:set behavior_compat_options='end_month_calculate,display_leading_zero'; -**表 1** 兼容性配置项 - -| **兼容性配置项** | **兼容性行为控制** | -| :------------------------------ | :----------------------------------------------------------- | -| display_leading_zero | 浮点数显示配置项。
- 不设置此配置项时,对于-1\~0和0\~1之间的小数,不显示小数点前的0。比如:
`MogDB=# select 0.1231243 as a, 0.1231243::numeric as b,0.1231243::integer(10,3) as c, length(0.1242343) as d; a | b | c | d ----------+----------+------+--- .1231243 | .1231243 | .123 | 8 (1 row)`
- 设置此配置项时,对于-1\~0和0\~1之间的小数,显示小数点前的0。比如:
`MogDB=# select 0.1231243 as a, 0.1231243::numeric as b,0.1231243::integer(10,3) as c, length(0.1242343) as d; a | b | c | d -----------+-----------+-------+--- 0.1231243 | 0.1231243 | 0.123 | 9 (1 row)` | -| end_month_calculate | add_months函数计算逻辑配置项。
假定函数add_months的两个参数分别为param1和param2,param1的月份和param2的和为月份result。
- 不设置此配置项时,如果param1的日期(Day字段)为月末,并且param1的日期(Day字段)比result月份的月末日期小,计算结果中的日期字段(Day字段)和param1的日期字段保持一致。比如,
`MogDB=# select add_months('2018-02-28',3) from sys_dummy; add_months ---------------------- 2018-05-28 00:00:00 (1 row)`
- 设置此配置项时,如果param1的日期(Day字段)为月末,并且param1的日期(Day字段)比result月份的月末日期比小,计算结果中的日期字段(Day字段)和result的月末日期保持一致。比如,
`MogDB=# select add_months('2018-02-28',3) from sys_dummy; add_months ---------------------- 2018-05-31 00:00:00 (1 row)` | -| compat_analyze_sample | analyze采样行为配置项。
设置此配置项时,会优化analyze的采样行为,主要体现在analyze时全局采样会更精确的控制在3万条左右,更好的控制analyze时DBnode端的内存消耗,保证analyze性能的稳定性。 | -| 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而报越界错误。 | -| 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操作失败。 | -| hide_tailing_zero | numeric显示配置项。不设置此项时,numeric按照指定精度显示。设置此项时,所有输出numeric的场景均隐藏小数点后的末尾0,包括显示指定format精度情况。
`MogDB=# set behavior_compat_options='hide_tailing_zero';`
`MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); a | to_char ---------+---------- 123.123 | 123.123 (1 row)`
`MogDB=# set behavior_compat_options='';`
`MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); a | to_char ----------------+------------- 123.1230000000 | 123.123000 (1 row)` | -| rownum_type_compat | 控制ROWNUM的类型,ROWNUM默认类型为INT8,设置此参数后,ROWNUM类型变更为NUMERIC类型。 | -| aformat_null_test | 控制rowtype类型判空逻辑,设置此项时,对于rowtype is not null判断,当一行数据有一列不为空的时候返回ture。否则,对于rowtype is not null判断,当一行数据所有列不为空的时候返回ture. | -| aformat_regexp_match | 控制正则表达式函数的匹配行为。
设置此项,且sql_compatibility参数的值为A或B时,正则表达式的 flags 参数支持的选项含义有变更:
1. “.”默认不能匹配 '\n' 字符。
2. flags 中包含n选项时,“.”能够匹配 '\n' 字符。
3. regexp_replace(source, pattern replacement) 函数替换所有匹配的子串。
4. regexp_replace(source, pattern, replacement, flags) 在 flags值为” 或者null时,返回值为null。
否则,正则表达式的 flags 参数支持的选项含义:
1. “.”默认能匹配 '\n' 字符。
2. flags 中的 n 选项表示按照多行模式匹配。
3. regexp_replace(source, pattern replacement) 函数仅替换第一个匹配到的子串。
4. regexp_replace(source, pattern, replacement, flags) 在 flags值为” 或者null时,返回值为替换后的字符串。 | -| compat_cursor | 控制隐式游标状态兼容行为。设置此项,且兼容O,隐式游标状态(SQL%FOUND、SQL%NOTFOUND、SQL%ISOPNE、SQL%ROWCOUNT)由原先的仅在当前执行的函数有效,拓展到包括本函数调用的子函数有效。 | -| proc_outparam_override | 控制存储过程出参的重载行为,打开该参数后,对于存储过程只有out出参部分不同的情况下,也可以正常调用。 | -| proc_implicit_for_loop_variable | 控制存储过程中FOR_LOOP查询语句行为设置此项时,在FOR rec IN query LOOP语句中,若rec已经定义,不会复用已经定义的rec变量,而且重新建立一个新的变量。否则,会复用已经定义的rec变量,不会建立新的变量。 | -| allow_procedure_compile_check | 控制存储过程中select语句和open cursor语句的编译检查设置此项时,在存储过程中执行select语句、open cursor for语句、cursor%rowtype语句、for rec in语句时,若查询的表不存在,则无法创建创建存储过程,不支持trigger函数的编译检查,若查询的表存在,则成功创建存储过程。 | -| char_coerce_compat | 控制char(n)类型向其它变长字符串类型转换时的行为。默认情况下char(n)类型转换其它变长字符串类型时会省略尾部的空格,开启该参数后,转换时不再省略尾部的空格,并且在转换时如果char(n)类型的长度超过其它变长字符串类型时将会报错。该参数仅在sql_compatibility参数的值为A时生效。 | -| truncate_numeric_tail_zero | numeric显示配置项。不设置此项时,numeric按照默认精度显示。设置此项时,除去to_char(numeric, format)这种显示设置精度的情况,所有输出numeric的场景均会隐藏小数点后的末尾0。例如:
`MogDB=# set behavior_compat_options='truncate_numeric_tail_zero';`
`MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); a | to_char ---------+------------- 123.123 | 123.123000 (1 row)`
`MogDB=# set behavior_compat_options='';`
`MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); a | to_char ----------------+------------- 123.1230000000 | 123.123000 (1 row)` | -| pgformat_substr | 控制substr(str, from, for)在不同场景下的表现。默认情况下,当from小于0时,substr将从字符串尾部开始计数;当for小于1时,substr将返回NULL。开启该参数后,当from小于0时,将从字符串的第一位的前(-from + 1)位开始计数;当for小于0时,substr将报错。该参数仅在sql_compatibility参数的值为PG时生效。 | -| allow_orderby_undistinct_column | SQL语法兼容B的情况下,开启此参数后,select语句支持order by后面的列不在distinct中。如: select distinct a from test order by b;
注意:该参数只支持distinct,不支持distinct on,且当 DOLPHIN 插件存在时不生效,转由 dolphin.sql_mode 参数控制。dolphin.sql_mode 未设置 sql_mode_full_group 选项时相当于打开此选项。 | -| select_into_return_null | 在B或PG兼容模式下,开启此参数后,存储过程语句SELECT select_expressions INTO [STRICT] target FROM ... 允许在不指定STRICT并且查询结果为空时给变量赋NULL值。 | +当前支持的兼容性配置项及其行为控制如下: + +- display_leading_zero + + 浮点数显示配置项。 + + - 不设置此配置项时,对于-1\~0和0\~1之间的小数,不显示小数点前的0。比如: + + ```sql + MogDB=# select 0.1231243 as a, 0.1231243::numeric as b,0.1231243::integer(10,3) as c, length(0.1242343) as d; + a | b | c | d + ----------+----------+------+--- + .1231243 | .1231243 | .123 | 8 + (1 row) + ``` + + - 设置此配置项时,对于-1\~0和0\~1之间的小数,显示小数点前的0。比如: + + ```sql + MogDB=# select 0.1231243 as a, 0.1231243::numeric as b,0.1231243::integer(10,3) as c, length(0.1242343) as d; + a | b | c | d + -----------+-----------+-------+--- + 0.1231243 | 0.1231243 | 0.123 | 9 + (1 row) + ``` + +- end_month_calculate + + add_months函数计算逻辑配置项。 + + 假定函数add_months的两个参数分别为param1和param2,param1的月份和param2的和为月份result。 + + - 不设置此配置项时,如果param1的日期(Day字段)为月末,并且param1的日期(Day字段)比result月份的月末日期小,计算结果中的日期字段(Day字段)和param1的日期字段保持一致。比如: + + ```sql + MogDB=# select add_months('2018-02-28',3) from sys_dummy; + add_months + \---------------------\ + 2018-05-28 00:00:00 + (1 row) + ``` + + - 设置此配置项时,如果param1的日期(Day字段)为月末,并且param1的日期(Day字段)比result月份的月末日期比小,计算结果中的日期字段(Day字段)和result的月末日期保持一致。比如: + + ```sql + MogDB=# select add_months('2018-02-28',3) from sys_dummy; + add_months + \---------------------\ + 2018-05-31 00:00:00 + (1 row) + ``` + +- compat_analyze_sample + + analyze采样行为配置项。 + + 设置此配置项时,会优化analyze的采样行为,主要体现在analyze时全局采样会更精确的控制在3万条左右,更好的控制analyze时DBnode端的内存消耗,保证analyze性能的稳定性。 + +- 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保持一致,否则默认与Oracle保持一致。 + +- unbind_dive_bound + + 控制对整数除法的结果进行范围校验。 + + 若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 + +- return_null_string + + 控制函数lpad()和rpad()结果为空字符串''的显示配置项。 + + 不设置此配置项时,空字符串显示为NULL。 + + ```sql + MogDB=# select length(lpad('123',0,'*')) from sys_dummy; + length + \--------\ + (1 row) + ``` + + 设置此配置项时,空字符串显示为''。 + + ```sql + 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操作失败。 + +- hide_tailing_zero + + numeric显示配置项。不设置此项时,numeric按照指定精度显示。设置此项时,所有输出numeric的场景均隐藏小数点后的末尾0,包括显示指定format精度情况。 + + ```sql + MogDB=# set behavior_compat_options='hide_tailing_zero'; + MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); + a | to_char + ---------+---------- + 123.123 | 123.123 + (1 row) + MogDB=# set behavior_compat_options=''; + MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); + a | to_char + ----------------+------------- + 123.1230000000 | 123.123000 + (1 row) + ``` + +- rownum_type_compat + + 控制ROWNUM的类型,ROWNUM默认类型为INT8,设置此参数后,ROWNUM类型变更为NUMERIC类型。 + +- aformat_null_test + + 控制rowtype类型判空逻辑,设置此项时,对于rowtype is not null判断,当一行数据有一列不为空的时候返回ture。 + + 否则,对于rowtype is not null判断,当一行数据所有列不为空的时候返回ture。 + +- aformat_regexp_match + + 控制正则表达式函数的匹配行为。 + + 设置此项,且sql_compatibility参数的值为A或B时,正则表达式的flags参数支持的选项含义有变更: + + 1. “.”默认不能匹配 '\n' 字符。 + + 2. flags 中包含n选项时,“.”能够匹配 '\n' 字符。 + + 3. regexp_replace(source, pattern replacement) 函数替换所有匹配的子串。 + + 4. regexp_replace(source, pattern, replacement, flags) 在 flags值为''或者null时,返回值为null。 + + 否则,正则表达式的 flags 参数支持的选项含义: + + 1. “.”默认能匹配 '\n' 字符。 + 2. flags中的n选项表示按照多行模式匹配。 + 3. regexp_replace(source, pattern replacement)函数仅替换第一个匹配到的子串。 + 4. regexp_replace(source, pattern, replacement, flags)在flags值为''或者null时,返回值为替换后的字符串。 + +- compat_cursor + + 控制隐式游标状态兼容行为。设置此项,且兼容O,隐式游标状态(SQL%FOUND、SQL%NOTFOUND、SQL%ISOPNE、SQL%ROWCOUNT)由原先的仅在当前执行的函数有效,拓展到包括本函数调用的子函数有效。 + +- proc_outparam_override + + 控制存储过程出参的重载行为,打开该参数后,对于存储过程只有out出参部分不同的情况下,也可以正常调用。 + +- proc_implicit_for_loop_variable + + 控制存储过程中FOR_LOOP查询语句行为设置此项时,在FOR rec IN query LOOP语句中,若rec已经定义,不会复用已经定义的rec变量,而且重新建立一个新的变量。否则,会复用已经定义的rec变量,不会建立新的变量。 + +- allow_procedure_compile_check + + 控制存储过程中select语句和open cursor语句的编译检查设置此项时,在存储过程中执行select语句、open cursor for语句、cursor%rowtype语句、for rec in语句时,若查询的表不存在,则无法创建创建存储过程,不支持trigger函数的编译检查,若查询的表存在,则成功创建存储过程。 + +- char_coerce_compat + + 控制char(n)类型向其它变长字符串类型转换时的行为。默认情况下char(n)类型转换其它变长字符串类型时会省略尾部的空格,开启该参数后,转换时不再省略尾部的空格,并且在转换时如果char(n)类型的长度超过其它变长字符串类型时将会报错。该参数仅在sql_compatibility参数的值为A时生效。 + +- truncate_numeric_tail_zero + + numeric显示配置项。不设置此项时,numeric按照默认精度显示。设置此项时,除去to_char(numeric, format)这种显示设置精度的情况,所有输出numeric的场景均会隐藏小数点后的末尾0。例如: + + ```sql + MogDB=# set behavior_compat_options='truncate_numeric_tail_zero'; + MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); + a | to_char + ---------+------------- + 123.123 | 123.123000 + (1 row) + MogDB=# set behavior_compat_options=''; + MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); + a | to_char + ----------------+------------- + 123.1230000000 | 123.123000 + (1 row) + ``` + +- pgformat_substr + + 控制substr(str, from, for)在不同场景下的表现。默认情况下,当from小于0时,substr将从字符串尾部开始计数;当for小于1时,substr将返回NULL。开启该参数后,当from小于0时,将从字符串的第一位的前(-from + 1)位开始计数;当for小于0时,substr将报错。该参数仅在sql_compatibility参数的值为PG时生效。 + +- allow_orderby_undistinct_column + + SQL语法兼容B的情况下,开启此参数后,select语句支持order by后面的列不在distinct中。如:`select distinct a from test order by b;` + + > 注意:该参数只支持distinct,不支持distinct on,且当DOLPHIN插件存在时不生效,转由dolphin.sql_mode参数控制。dolphin.sql_mode未设置sql_mode_full_group选项时相当于打开此选项。 + +- select_into_return_null + + 在B或PG兼容模式下,开启此参数后,存储过程语句`SELECT select_expressions INTO [STRICT] target FROM ...`允许在不指定STRICT并且查询结果为空时给变量赋NULL值。 + +- convert_string_digit_to_numeric + + 控制是否将表中以字符串形式表示的numeric常量和数字类型作比较时统一都转换为numeric类型再进行比较。 + + ```sql + MogDB=# create table test1(c1 int, c2 varchar); + MogDB=# insert into test1 values(2, '1.1'); + MogDB=# set behavior_compat_options = ''; + MogDB=# select * from test1 where c2 > 1; + ERROR: invalid input syntax for type bigint: "1.1" + MogDB=# set behavior_compat_options = 'convert_string_digit_to_numeric'; + MogDB=# select * test1 from where c2 > 1; + c1 | c2 + ----+----- + 2 | 1.1 + (1 row) + ``` + +- plsql_security_definer + + 开启此参数后,创建存储过程时默认为定义者权限。 + +- skip_insert_gs_source + + 开启此参数后,创建PL/SQL对象时不再插入DBE_PLDEVELOPER.gs_source表中。 ## plpgsql.variable_conflict -**参数说明**: 设置同名的存储过程变量和表的列的使用优先级。 +**参数说明**:设置同名的存储过程变量和表的列的使用优先级。 该参数属于USERSET类型参数,仅支持表[GUC参数设置方式](../../../reference-guide/guc-parameters/appendix.md)中对应设置方法3进行设置。 -**取值范围**: 字符串 +**取值范围**:字符串 - error表示遇到存储过程变量和表的列名同名则编译报错。 - use_variable表示存储过程变量和表的列名同名则优先使用变量。 - use_column表示存储过程变量和表的列名同名则优先使用列名。 -**默认值**: error +**默认值**:error ## td_compatible_truncation **参数说明**: 控制是否开启与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)中对应设置方法进行设置。 -**取值范围**: 布尔型 +**取值范围**:布尔型 - on表示启动超长字符串自动截断功能。 - off表示停止超长字符串自动截断功能。 -**默认值**: off +**默认值**:off ## uppercase_attribute_name @@ -229,13 +451,13 @@ date: 2021-04-20 ## lastval_supported -**参数说明**: 控制是否可以使用lastval函数。 +**参数说明**:控制是否可以使用lastval函数。 该参数属于POSTMASTER类型参数,请参考表[GUC参数分类](../../../reference-guide/guc-parameters/appendix.md)中对应设置方法进行设置。 -**取值范围**: 布尔型 +**取值范围**:布尔型 - on表示支持lastval函数,同时nextval函数不支持下推。 - off表示不支持lastval函数,同时nextval函数可以下推。 -**默认值**: off +**默认值**:off diff --git a/product/zh/docs-mogdb/v5.1/_index.md b/product/zh/docs-mogdb/v5.1/_index.md index 03a8ff827be586565613614bdd3d80dbabdd26de..97eda78901565f63776d9ca7c886bde05f1facad 100644 --- a/product/zh/docs-mogdb/v5.1/_index.md +++ b/product/zh/docs-mogdb/v5.1/_index.md @@ -73,7 +73,7 @@ date: 2022-08-07 -[PTK部署运维工具](../../docs-ptk/v1.0/overview.md) +[PTK部署运维工具](../../docs-ptk/v1.1/overview.md) [MTK异构数据库迁移](../../docs-mtk/v2.0/overview.md) diff --git a/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/type-conversion-for-union-and-decode.md b/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/type-conversion-for-union-and-decode.md index 6a94fdbc9c78f8d93ebf87296fa4ff31e89e38df..ce494bf7416fcfe20ad35b026b2ff65beabca28b 100644 --- a/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/type-conversion-for-union-and-decode.md +++ b/product/zh/docs-mogdb/v5.1/characteristic-description/compatibility/type-conversion-for-union-and-decode.md @@ -37,7 +37,7 @@ decode(expr, search1, result1, serach2, result2,..., default) ## 特性约束 -本特性在设置[sql_beta_feature](../../reference-guide/guc-parameters/query-planning/other-optimizer-options#sql_beta_feature)参数为a_style_corece时生效(`set sql_beta_feature = 'a_style_corece';`) +本特性在设置[sql_beta_feature](../../reference-guide/guc-parameters/query-planning/other-optimizer-options.md#sql_beta_feature)参数为a_style_corece时生效(`set sql_beta_feature = 'a_style_corece';`) ## 示例 diff --git a/product/zh/docs-mogdb/v5.1/characteristic-description/high-availability/12-parallel-logical-decoding.md b/product/zh/docs-mogdb/v5.1/characteristic-description/high-availability/12-parallel-logical-decoding.md index 98567f073e5986451a6e8b397e5a99147763f0da..e6145984c60c0f1c55e4e325b0965a7a8e08f9b8 100644 --- a/product/zh/docs-mogdb/v5.1/characteristic-description/high-availability/12-parallel-logical-decoding.md +++ b/product/zh/docs-mogdb/v5.1/characteristic-description/high-availability/12-parallel-logical-decoding.md @@ -35,22 +35,17 @@ date: 2022-05-10 4. 解码配置选项parallel-decode-num > 1且<= 20,指定并行的解码线程数。 5. 不支持DDL语句解码。 6. 不支持列存、数据页复制的解码。 -7. 不支持解码分布式事务,当前机制为从DN解码,无法保证分布式事务一致性解码。 -8. 单条元组大小不超过1GB,考虑解码结果可能大于插入数据,因此建议单条元组大小不超过500MB。 -9. 不支持压缩表的DML语句解码。 -10. MogDB支持解码的数据类型为:INTEGER、BIGINT、SMALLILNT、TINYINT、SERIAL、SMALLSERIAL、BIGSERIAL、FLOAT、DOUBLE PRECISION、DATE、TIME[WITHOUT TIME ZONE]、TIMESTAMP[WITHOUT TIME ZONE]、CHAR(n)、VARCHAR(n)、TEXT。 -11. 在需要ssl连接的场景,需要前置条件保证guc参数ssl = on。 -12. 不支持interval partition表复制。 -13. 在事务中执行DDL语句后,该DDL语句与之后的语句不会被解码。 -14. 如需进行备机解码,需在对应主机上设置guc参数enable_slot_log = on。 -15. 当前不支持超大CLOB解码。 -16. 不允许主备,多个备机同时使用同一个复制槽解码,否则会产生数据不一致。 -17. 禁止在使用逻辑复制槽时在其他节点对该复制槽进行操作,删除复制槽的操作需在该复制槽停止解码后执行。 -18. 仅支持内置'j'风格导出,不支持wal2json插件。 - -## 依赖关系 - -依赖备机解码。 +7. 单条元组大小不超过1GB,考虑解码结果可能大于插入数据,因此建议单条元组大小不超过500MB。 +8. 不支持压缩表的DML语句解码。 +9. MogDB支持解码的数据类型为:INTEGER、BIGINT、SMALLILNT、TINYINT、SERIAL、SMALLSERIAL、BIGSERIAL、FLOAT、DOUBLE PRECISION、DATE、TIME[WITHOUT TIME ZONE]、TIMESTAMP[WITHOUT TIME ZONE]、CHAR(n)、VARCHAR(n)、TEXT。 +10. 在需要ssl连接的场景,需要前置条件保证guc参数ssl = on。 +11. 不支持interval partition表复制。 +12. 在事务中执行DDL语句后,该DDL语句与之后的语句不会被解码。 +13. 如需进行备机解码,需在对应主机上设置guc参数enable_slot_log = on。 +14. 当前不支持超大CLOB解码。 +15. 不允许主备,多个备机同时使用同一个复制槽解码,否则会产生数据不一致。 +16. 禁止在使用逻辑复制槽时在其他节点对该复制槽进行操作,删除复制槽的操作需在该复制槽停止解码后执行。 +17. 仅支持内置'j'风格导出,不支持wal2json插件。 ## 相关页面 diff --git a/product/zh/docs-mogdb/v5.1/characteristic-description/high-performance/join-predicate-pushdown.md b/product/zh/docs-mogdb/v5.1/characteristic-description/high-performance/join-predicate-pushdown.md index 800426c76535af649cccea8db8f75821e173187a..5d112b6cfd2ae18f7c29226a0750d41b1a919fcb 100644 --- a/product/zh/docs-mogdb/v5.1/characteristic-description/high-performance/join-predicate-pushdown.md +++ b/product/zh/docs-mogdb/v5.1/characteristic-description/high-performance/join-predicate-pushdown.md @@ -25,7 +25,7 @@ Join内外表包含无法提升的视图时,join无法选择nested loop + inde ## 特性约束 -- 本功能受参数[rewrite_rule](../../reference-guide/guc-parameters/query-planning/other-optimizer-options#rewrite_rule)控制,设置predpush选项后支持自动对SQL中满足要求的join条件下推。 +- 本功能受参数[rewrite_rule](../../reference-guide/guc-parameters/query-planning/other-optimizer-options.md#rewrite_rule)控制,设置predpush选项后支持自动对SQL中满足要求的join条件下推。 - rewrite_rule参数设置predpushforce后,支持通过hint进行调优,hint包含两种,一种是predpush,可以跨query block设置,另一种是predpush_same_level,对同层表进行设置。 - 条件下推以顺序为基础,如果希望下推到某个指定的子查询中,需要设置predpushforce并通过hint指定。 - 子查询公共约束条件(下推后可能导致结果集错误): @@ -80,4 +80,4 @@ MogDB=# explain select * from t1, (select a, max(b) b from t2 group by 1) st2 wh ## 相关页面 -[rewrite_rule](../../reference-guide/guc-parameters/query-planning/other-optimizer-options#rewrite_rule)、[使用Plan Hint进行调优](../../performance-tuning/sql-tuning/hint-based-tuning.md) \ No newline at end of file +[rewrite_rule](../../reference-guide/guc-parameters/query-planning/other-optimizer-options.md#rewrite_rule)、[使用Plan Hint进行调优](../../performance-tuning/sql-tuning/hint-based-tuning.md) \ No newline at end of file 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 0ec5e21fb8ec32ef2580373fe25e1f7fe5f4aa2c..fb63256cdcad02a0227973f86be424d18e129b1a 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 @@ -146,47 +146,287 @@ date: 2021-04-20 ## behavior_compat_options -**参数说明**: 数据库兼容性行为配置项,该参数的值由若干个配置项用逗号隔开构成。 +**参数说明**:数据库兼容性行为配置项,该参数的值由若干个配置项用逗号隔开构成。 该参数属于USERSET类型参数,请参考表[GUC参数分类](../../../reference-guide/guc-parameters/appendix.md)中对应设置方法进行设置。 -**取值范围**: 字符串 +**取值范围**:字符串 -**默认值**: 空 +**默认值**:空 -> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **说明**: +> ![img](https://cdn-mogdb.enmotech.com/docs-media/icon/icon-note.gif) **说明**: > -> - 当前只支持[表1](#jianrongxing)。 > - 配置多个兼容性配置项时,相邻配置项用逗号隔开,例如:set behavior_compat_options='end_month_calculate,display_leading_zero'; -**表 1** 兼容性配置项 - -| **兼容性配置项** | **兼容性行为控制** | -| :------------------------------ | :----------------------------------------------------------- | -| display_leading_zero | 浮点数显示配置项。
- 不设置此配置项时,对于-1\~0和0\~1之间的小数,不显示小数点前的0。比如:
`MogDB=# select 0.1231243 as a, 0.1231243::numeric as b,0.1231243::integer(10,3) as c, length(0.1242343) as d; a | b | c | d ----------+----------+------+--- .1231243 | .1231243 | .123 | 8 (1 row)`
- 设置此配置项时,对于-1\~0和0\~1之间的小数,显示小数点前的0。比如:
`MogDB=# select 0.1231243 as a, 0.1231243::numeric as b,0.1231243::integer(10,3) as c, length(0.1242343) as d; a | b | c | d -----------+-----------+-------+--- 0.1231243 | 0.1231243 | 0.123 | 9 (1 row)` | -| end_month_calculate | add_months函数计算逻辑配置项。
假定函数add_months的两个参数分别为param1和param2,param1的月份和param2的和为月份result。
- 不设置此配置项时,如果param1的日期(Day字段)为月末,并且param1的日期(Day字段)比result月份的月末日期小,计算结果中的日期字段(Day字段)和param1的日期字段保持一致。比如,
`MogDB=# select add_months('2018-02-28',3) from sys_dummy; add_months ---------------------- 2018-05-28 00:00:00 (1 row)`
- 设置此配置项时,如果param1的日期(Day字段)为月末,并且param1的日期(Day字段)比result月份的月末日期比小,计算结果中的日期字段(Day字段)和result的月末日期保持一致。比如,
`MogDB=# select add_months('2018-02-28',3) from sys_dummy; add_months ---------------------- 2018-05-31 00:00:00 (1 row)` | -| compat_analyze_sample | analyze采样行为配置项。
设置此配置项时,会优化analyze的采样行为,主要体现在analyze时全局采样会更精确的控制在3万条左右,更好的控制analyze时DBnode端的内存消耗,保证analyze性能的稳定性。 | -| 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_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操作失败。 | -| hide_tailing_zero | numeric显示配置项。不设置此项时,numeric按照指定精度显示。设置此项时,所有输出numeric的场景均隐藏小数点后的末尾0,包括显示指定format精度情况。
`MogDB=# set behavior_compat_options='hide_tailing_zero';`
`MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); a | to_char ---------+---------- 123.123 | 123.123 (1 row)`
`MogDB=# set behavior_compat_options='';`
`MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); a | to_char ----------------+------------- 123.1230000000 | 123.123000 (1 row)` | -| rownum_type_compat | 控制ROWNUM的类型,ROWNUM默认类型为INT8,设置此参数后,ROWNUM类型变更为NUMERIC类型。 | -| aformat_null_test | 控制rowtype类型判空逻辑,设置此项时,对于rowtype is not null判断,当一行数据有一列不为空的时候返回ture。否则,对于rowtype is not null判断,当一行数据所有列不为空的时候返回ture. | -| aformat_regexp_match | 控制正则表达式函数的匹配行为。
设置此项,且sql_compatibility参数的值为A或B时,正则表达式的 flags 参数支持的选项含义有变更:
1. “.”默认不能匹配 '\n' 字符。
2. flags 中包含n选项时,“.”能够匹配 '\n' 字符。
3. regexp_replace(source, pattern replacement) 函数替换所有匹配的子串。
4. regexp_replace(source, pattern, replacement, flags) 在 flags值为” 或者null时,返回值为null。
否则,正则表达式的 flags 参数支持的选项含义:
1. “.”默认能匹配 '\n' 字符。
2. flags 中的 n 选项表示按照多行模式匹配。
3. regexp_replace(source, pattern replacement) 函数仅替换第一个匹配到的子串。
4. regexp_replace(source, pattern, replacement, flags) 在 flags值为” 或者null时,返回值为替换后的字符串。 | -| compat_cursor | 控制隐式游标状态兼容行为。设置此项,且兼容O,隐式游标状态(SQL%FOUND、SQL%NOTFOUND、SQL%ISOPNE、SQL%ROWCOUNT)由原先的仅在当前执行的函数有效,拓展到包括本函数调用的子函数有效。 | -| proc_outparam_override | 控制存储过程出参的重载行为,打开该参数后,对于存储过程只有out出参部分不同的情况下,也可以正常调用。 | -| proc_implicit_for_loop_variable | 控制存储过程中FOR_LOOP查询语句行为设置此项时,在FOR rec IN query LOOP语句中,若rec已经定义,不会复用已经定义的rec变量,而且重新建立一个新的变量。否则,会复用已经定义的rec变量,不会建立新的变量。 | -| allow_procedure_compile_check | 控制存储过程中select语句和open cursor语句的编译检查设置此项时,在存储过程中执行select语句、open cursor for语句、cursor%rowtype语句、for rec in语句时,若查询的表不存在,则无法创建创建存储过程,不支持trigger函数的编译检查,若查询的表存在,则成功创建存储过程。 | -| char_coerce_compat | 控制char(n)类型向其它变长字符串类型转换时的行为,以及char(n)和varchar操作时的行为。默认情况下char(n)类型转换其它变长字符串类型时会省略尾部的空格,开启该参数后,转换时不再省略尾部的空格,并且在转换时如果char(n)类型的长度超过其它变长字符串类型时将会报错;开启该参数后,char(n)和varchar操作时,例如比较操作符,首先各自转换为text类型再进行操作,具体表现为在操作时不会忽略尾部空格,如' '::char(5)和' '::varchar(5)不相等。该参数仅在sql_compatibility参数的值为A时生效。 | -| truncate_numeric_tail_zero | numeric显示配置项。不设置此项时,numeric按照默认精度显示。设置此项时,除去to_char(numeric, format)这种显示设置精度的情况,所有输出numeric的场景均会隐藏小数点后的末尾0。例如:
`MogDB=# set behavior_compat_options='truncate_numeric_tail_zero';`
`MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); a | to_char ---------+------------- 123.123 | 123.123000 (1 row)`
`MogDB=# set behavior_compat_options='';`
`MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); a | to_char ----------------+------------- 123.1230000000 | 123.123000 (1 row)` | -| pgformat_substr | 控制substr(str, from, for)在不同场景下的表现。默认情况下,当from小于0时,substr将从字符串尾部开始计数;当for小于1时,substr将返回NULL。开启该参数后,当from小于0时,将从字符串的第一位的前(-from + 1)位开始计数;当for小于0时,substr将报错。该参数仅在sql_compatibility参数的值为PG时生效。 | -| allow_orderby_undistinct_column | SQL语法兼容B的情况下,开启此参数后,select语句支持order by后面的列不在distinct中。如: select distinct a from test order by b;
注意:该参数只支持distinct,不支持distinct on,且当 DOLPHIN 插件存在时不生效,转由 dolphin.sql_mode 参数控制。dolphin.sql_mode 未设置 sql_mode_full_group 选项时相当于打开此选项。 | -| select_into_return_null | 在B或PG兼容模式下,开启此参数后,存储过程语句SELECT select_expressions INTO [STRICT] target FROM ... 允许在不指定STRICT并且查询结果为空时给变量赋NULL值。 | -| accept_empty_str | 在A兼容模式下,关闭此参数后,MogDB处理空字符串时会当做NULL处理;反之则正常接受空字符串。例如:
MogDB=# set behavior_compat_options='accept_empty_str';
MogDB=# select '' is null;
?column?
----------
f
(1 row)
MogDB=# set behavior_compat_options='';
MogDB=# select '' is null;
?column?
----------
t
(1 row) | +当前支持的兼容性配置项及其行为控制如下: + +- display_leading_zero + + 浮点数显示配置项。 + + - 不设置此配置项时,对于-1\~0和0\~1之间的小数,不显示小数点前的0。比如: + + ```sql + MogDB=# select 0.1231243 as a, 0.1231243::numeric as b,0.1231243::integer(10,3) as c, length(0.1242343) as d; + a | b | c | d + ----------+----------+------+--- + .1231243 | .1231243 | .123 | 8 + (1 row) + ``` + + - 设置此配置项时,对于-1\~0和0\~1之间的小数,显示小数点前的0。比如: + + ```sql + MogDB=# select 0.1231243 as a, 0.1231243::numeric as b,0.1231243::integer(10,3) as c, length(0.1242343) as d; + a | b | c | d + -----------+-----------+-------+--- + 0.1231243 | 0.1231243 | 0.123 | 9 + (1 row) + ``` + +- end_month_calculate + + add_months函数计算逻辑配置项。 + + 假定函数add_months的两个参数分别为param1和param2,param1的月份和param2的和为月份result。 + + - 不设置此配置项时,如果param1的日期(Day字段)为月末,并且param1的日期(Day字段)比result月份的月末日期小,计算结果中的日期字段(Day字段)和param1的日期字段保持一致。比如: + + ```sql + MogDB=# select add_months('2018-02-28',3) from sys_dummy; + add_months + \---------------------\ + 2018-05-28 00:00:00 + (1 row) + ``` + + - 设置此配置项时,如果param1的日期(Day字段)为月末,并且param1的日期(Day字段)比result月份的月末日期比小,计算结果中的日期字段(Day字段)和result的月末日期保持一致。比如: + + ```sql + MogDB=# select add_months('2018-02-28',3) from sys_dummy; + add_months + \---------------------\ + 2018-05-31 00:00:00 + (1 row) + ``` + +- compat_analyze_sample + + analyze采样行为配置项。 + + 设置此配置项时,会优化analyze的采样行为,主要体现在analyze时全局采样会更精确的控制在3万条左右,更好的控制analyze时DBnode端的内存消耗,保证analyze性能的稳定性。 + +- 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保持一致,否则默认与Oracle保持一致。 + +- unbind_dive_bound + + 控制对整数除法的结果进行范围校验。 + + 若设置此配置项,则不需要对除法结果做范围校验,例如,INT_MIN/(-1)可以得到输出结果为INT_MAX+1,反之,则会因为超过结果大于INT_MAX而报越界错误。 + +- return_null_string + + 控制函数lpad()和rpad()结果为空字符串''的显示配置项。 + + 不设置此配置项时,空字符串显示为NULL。 + + ```sql + MogDB=# select length(lpad('123',0,'*')) from sys_dummy; + length + \--------\ + (1 row) + ``` + + 设置此配置项时,空字符串显示为''。 + + ```sql + 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操作失败。 + +- hide_tailing_zero + + numeric显示配置项。不设置此项时,numeric按照指定精度显示。设置此项时,所有输出numeric的场景均隐藏小数点后的末尾0,包括显示指定format精度情况。 + + ```sql + MogDB=# set behavior_compat_options='hide_tailing_zero'; + MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); + a | to_char + ---------+---------- + 123.123 | 123.123 + (1 row) + MogDB=# set behavior_compat_options=''; + MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); + a | to_char + ----------------+------------- + 123.1230000000 | 123.123000 + (1 row) + ``` + +- rownum_type_compat + + 控制ROWNUM的类型,ROWNUM默认类型为INT8,设置此参数后,ROWNUM类型变更为NUMERIC类型。 + +- aformat_null_test + + 控制rowtype类型判空逻辑,设置此项时,对于rowtype is not null判断,当一行数据有一列不为空的时候返回ture。 + + 否则,对于rowtype is not null判断,当一行数据所有列不为空的时候返回ture。 + +- aformat_regexp_match + + 控制正则表达式函数的匹配行为。 + + 设置此项,且sql_compatibility参数的值为A或B时,正则表达式的flags参数支持的选项含义有变更: + + 1. “.”默认不能匹配 '\n' 字符。 + + 2. flags 中包含n选项时,“.”能够匹配 '\n' 字符。 + + 3. regexp_replace(source, pattern replacement) 函数替换所有匹配的子串。 + + 4. regexp_replace(source, pattern, replacement, flags) 在 flags值为''或者null时,返回值为null。 + + 否则,正则表达式的 flags 参数支持的选项含义: + + 1. “.”默认能匹配 '\n' 字符。 + 2. flags中的n选项表示按照多行模式匹配。 + 3. regexp_replace(source, pattern replacement)函数仅替换第一个匹配到的子串。 + 4. regexp_replace(source, pattern, replacement, flags)在flags值为''或者null时,返回值为替换后的字符串。 + +- compat_cursor + + 控制隐式游标状态兼容行为。设置此项,且兼容O,隐式游标状态(SQL%FOUND、SQL%NOTFOUND、SQL%ISOPNE、SQL%ROWCOUNT)由原先的仅在当前执行的函数有效,拓展到包括本函数调用的子函数有效。 + +- proc_outparam_override + + 控制存储过程出参的重载行为,打开该参数后,对于存储过程只有out出参部分不同的情况下,也可以正常调用。 + +- proc_implicit_for_loop_variable + + 控制存储过程中FOR_LOOP查询语句行为设置此项时,在FOR rec IN query LOOP语句中,若rec已经定义,不会复用已经定义的rec变量,而且重新建立一个新的变量。否则,会复用已经定义的rec变量,不会建立新的变量。 + +- allow_procedure_compile_check + + 控制存储过程中select语句和open cursor语句的编译检查设置此项时,在存储过程中执行select语句、open cursor for语句、cursor%rowtype语句、for rec in语句时,若查询的表不存在,则无法创建创建存储过程,不支持trigger函数的编译检查,若查询的表存在,则成功创建存储过程。 + +- char_coerce_compat + + 控制char(n)类型向其它变长字符串类型转换时的行为。默认情况下char(n)类型转换其它变长字符串类型时会省略尾部的空格,开启该参数后,转换时不再省略尾部的空格,并且在转换时如果char(n)类型的长度超过其它变长字符串类型时将会报错。该参数仅在sql_compatibility参数的值为A时生效。 + +- truncate_numeric_tail_zero + + numeric显示配置项。不设置此项时,numeric按照默认精度显示。设置此项时,除去to_char(numeric, format)这种显示设置精度的情况,所有输出numeric的场景均会隐藏小数点后的末尾0。例如: + + ```sql + MogDB=# set behavior_compat_options='truncate_numeric_tail_zero'; + MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); + a | to_char + ---------+------------- + 123.123 | 123.123000 + (1 row) + MogDB=# set behavior_compat_options=''; + MogDB=# select cast(123.123 as numeric(15,10)) as a, to_char(cast(123.123 as numeric(15,10)), '999D999999'); + a | to_char + ----------------+------------- + 123.1230000000 | 123.123000 + (1 row) + ``` + +- pgformat_substr + + 控制substr(str, from, for)在不同场景下的表现。默认情况下,当from小于0时,substr将从字符串尾部开始计数;当for小于1时,substr将返回NULL。开启该参数后,当from小于0时,将从字符串的第一位的前(-from + 1)位开始计数;当for小于0时,substr将报错。该参数仅在sql_compatibility参数的值为PG时生效。 + +- allow_orderby_undistinct_column + + SQL语法兼容B的情况下,开启此参数后,select语句支持order by后面的列不在distinct中。如:`select distinct a from test order by b;` + + > 注意:该参数只支持distinct,不支持distinct on,且当DOLPHIN插件存在时不生效,转由dolphin.sql_mode参数控制。dolphin.sql_mode未设置sql_mode_full_group选项时相当于打开此选项。 + +- select_into_return_null + + 在B或PG兼容模式下,开启此参数后,存储过程语句`SELECT select_expressions INTO [STRICT] target FROM ...`允许在不指定STRICT并且查询结果为空时给变量赋NULL值。 + +- convert_string_digit_to_numeric + + 控制是否将表中以字符串形式表示的numeric常量和数字类型作比较时统一都转换为numeric类型再进行比较。 + + ```sql + MogDB=# create table test1(c1 int, c2 varchar); + MogDB=# insert into test1 values(2, '1.1'); + MogDB=# set behavior_compat_options = ''; + MogDB=# select * from test1 where c2 > 1; + ERROR: invalid input syntax for type bigint: "1.1" + MogDB=# set behavior_compat_options = 'convert_string_digit_to_numeric'; + MogDB=# select * test1 from where c2 > 1; + c1 | c2 + ----+----- + 2 | 1.1 + (1 row) + ``` + +- plsql_security_definer + + 开启此参数后,创建存储过程时默认为定义者权限。 + +- skip_insert_gs_source + + 开启此参数后,创建PL/SQL对象时不再插入DBE_PLDEVELOPER.gs_source表中。 + +- accept_empty_str + + 在A兼容模式下,关闭此参数后,MogDB处理空字符串时会当做NULL处理;反之则正常接受空字符串。例如: + + ```sql + MogDB=# set behavior_compat_options='accept_empty_str'; + MogDB=# select '' is null; + ?column? + ---------- + f + (1 row) + MogDB=# set behavior_compat_options=''; + MogDB=# select '' is null; + ?column? + ---------- + t + (1 row) + ``` ## plsql_compile_check_options diff --git a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/safety-design.md b/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/safety-design.md index 6321ac23e32cf994d36dd929c2a1713542e9de8f..55c874092a0abd073de1114e4b0eb87e3991e315 100644 --- a/product/zh/docs-mogdb/v5.1/reference-guide/tool-reference/cluster-management/safety-design.md +++ b/product/zh/docs-mogdb/v5.1/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 --- @@ -11,7 +11,7 @@ date: 2023-04-07 - 创建自认证证书 - 自认证证书生成请参考([证书生成](../../../security-guide/security/1-client-access-authentication.md#证书生成))。 + 自认证证书生成请参考([证书生成](../../../security-guide/security/1-client-access-authentication.md#证书生成))。 对私钥密码的保护,使用cm encrypt工具,请参考[cm_ctl工具介绍](./introduction-to-cm_ctl-tool.md)。 @@ -53,7 +53,7 @@ date: 2023-04-07 - chmod 400 client.key.cipher - chmod 400 client.key.rand -3. 证书有效期的检测周期为1天,可通过ssl_cert_expire_check_interval设置。证书有效期剩余90天时会开始产生告警,可通过ssl_cert_expire_alert_threshold设置。(配置参数详见[ssl_cert_expire_alert_threshold](./cm-configuration-parameter/cm-cm_server.md))。 +3. 证书有效期的检测周期为1天,可通过ssl_cert_expire_check_interval设置。证书有效期剩余90天时会开始产生告警,可通过ssl_cert_expire_alert_threshold设置。(配置参数详见[ssl_cert_expire_alert_threshold](./cm-configuration-parameter/cm-cm_server.md))。 4. 客户端和服务端的证书吊销列表分别为client.crl、server.crl。