From cf989bd70db583966770e1ec25b56b8444a584e8 Mon Sep 17 00:00:00 2001 From: liyang0608 <2643278072qq.com> Date: Thu, 27 Aug 2020 10:44:39 +0800 Subject: [PATCH] sync dts --- .../en/docs/Developerguide/administrators.md | 2 +- .../en/docs/Developerguide/alter-function.md | 2 +- .../docs/Developerguide/boolean-data-types.md | 2 +- content/en/docs/Developerguide/create-type.md | 2 +- .../creating-and-managing-databases.md | 2 +- content/en/docs/Developerguide/drop-type.md | 2 +- content/en/docs/Developerguide/revoke.md | 2 +- .../docs/Developerguide/trigger-functions.md | 99 ++++++++++--------- .../using-gsql-to-connect-to-a-database.md | 4 +- content/zh/docs/Developerguide/CREATE-TYPE.md | 2 +- content/zh/docs/Developerguide/DROP-TYPE.md | 2 +- content/zh/docs/Developerguide/PG_ATTRDEF.md | 2 +- ...06\346\225\260\346\215\256\345\272\223.md" | 2 +- ...03\345\260\224\347\261\273\345\236\213.md" | 2 +- 14 files changed, 65 insertions(+), 62 deletions(-) diff --git a/content/en/docs/Developerguide/administrators.md b/content/en/docs/Developerguide/administrators.md index 79e037c3a..15acd8c94 100644 --- a/content/en/docs/Developerguide/administrators.md +++ b/content/en/docs/Developerguide/administrators.md @@ -2,7 +2,7 @@ ## Initial Users -The account automatically generated during openGauss installation is called an initial user. An initial user is the system, monitoring, O&M, and security policy administrator who has the highest-level permissions in the system and can perform all operations. The username is the same as the name of the OS user who installs openGauss,please refer to the *Installation Guide* for detail. +The account automatically generated during openGauss installation is called an initial user. An initial user is the system, monitoring, O&M, and security policy administrator who has the highest-level permissions in the system and can perform all operations. This account has the same name as the OS user used for openGauss installation. You need to manually set the password during the installation. After the first login, change the initial user's password in time. An initial user bypasses all permission checks. You are advised to use an initial user as a database administrator only for database management other than service running. diff --git a/content/en/docs/Developerguide/alter-function.md b/content/en/docs/Developerguide/alter-function.md index b0304493c..5801028e1 100644 --- a/content/en/docs/Developerguide/alter-function.md +++ b/content/en/docs/Developerguide/alter-function.md @@ -67,7 +67,7 @@ Only the owner of the function or a system administrator has the permission to r Specifies whether a parameter is an input or output parameter. - Value range: **IN**, **OUT**, **IN OUT** and **VARIDIC** + Value range: **IN**, **OUT**, **INOUT** and **VARIDIC** - **argname** diff --git a/content/en/docs/Developerguide/boolean-data-types.md b/content/en/docs/Developerguide/boolean-data-types.md index b97904508..e02c7bbdb 100644 --- a/content/en/docs/Developerguide/boolean-data-types.md +++ b/content/en/docs/Developerguide/boolean-data-types.md @@ -27,7 +27,7 @@ Valid literal values for the "true" state include: -TRUE, 't', 'true', 'y', 'yes', '1', 1, 'TRUE' +TRUE, 't', 'true', 'y', 'yes', '1', 1, 'TRUE',true Valid literal values for the "false" state include: diff --git a/content/en/docs/Developerguide/create-type.md b/content/en/docs/Developerguide/create-type.md index 20aa2790a..7147d9b58 100644 --- a/content/en/docs/Developerguide/create-type.md +++ b/content/en/docs/Developerguide/create-type.md @@ -232,7 +232,7 @@ postgres=# CREATE TYPE compfoo AS (f1 int, f2 text); postgres=# CREATE TABLE t1_compfoo(a int, b compfoo); postgres=# CREATE TABLE t2_compfoo(a int, b compfoo); postgres=# INSERT INTO t1_compfoo values(1,(1,'demo')); -postgres=# INSERT INTO t2_compfoo select * from t1_typ5; +postgres=# INSERT INTO t2_compfoo select * from t1_compfoo; postgres=# SELECT (b).f1 FROM t1_compfoo; postgres=# SELECT * FROM t1_compfoo t1 join t2_compfoo t2 on (t1.b).f1=(t1.b).f1; diff --git a/content/en/docs/Developerguide/creating-and-managing-databases.md b/content/en/docs/Developerguide/creating-and-managing-databases.md index 61d7e827e..ad2d4af2b 100644 --- a/content/en/docs/Developerguide/creating-and-managing-databases.md +++ b/content/en/docs/Developerguide/creating-and-managing-databases.md @@ -13,7 +13,7 @@ Only the database system administrator or users granted with database creation p ## Precautions -Assume that the database encoding is SQL\_ASCII. \(You can run the **show server\_encoding** command to query the encoding used for storing data in the current database.\) If the database object name contains multi-byte characters \(such as Chinese\) or if the object name length exceeds the allowed maximum \(63 bytes\), the database truncates the last byte \(not the last character\) of the object name. In this case, half characters may appear. +Assume that the database encoding is SQL\_ASCII. \(You can run the **show server\_encoding;** command to query the encoding used for storing data in the current database.\) If the database object name contains multi-byte characters \(such as Chinese\) or if the object name length exceeds the allowed maximum \(63 bytes\), the database truncates the last byte \(not the last character\) of the object name. In this case, half characters may appear. To resolve this problem, you need to: diff --git a/content/en/docs/Developerguide/drop-type.md b/content/en/docs/Developerguide/drop-type.md index 21b1a4781..044167cad 100644 --- a/content/en/docs/Developerguide/drop-type.md +++ b/content/en/docs/Developerguide/drop-type.md @@ -2,7 +2,7 @@ ## Function -**DROP TYPE** deletes a user-defined data type. Only the owner of a type has the **DROP TYPE** permission. +**DROP TYPE** deletes a user-defined data type. Superuser, sysadmin and the owner of a type has the **DROP TYPE** permission. ## Syntax diff --git a/content/en/docs/Developerguide/revoke.md b/content/en/docs/Developerguide/revoke.md index 2b38fab47..706d9efac 100644 --- a/content/en/docs/Developerguide/revoke.md +++ b/content/en/docs/Developerguide/revoke.md @@ -133,7 +133,7 @@ Permissions of a role include the permissions directly granted to the role, perm If **GRANT OPTION FOR** is specified, the permission cannot be granted to others, but permission itself is not revoked. -If user A holds the **UPDATE** permissions on a table and the **WITH GRANT OPTION** and has granted them to user B, the permissions that user B holds are called dependent permissions. If the permissions or the grant option held by user A is revoked, the dependent permissions still exist. Those dependent permissions are also revoked if **CASCADE** is specified. +If user A holds the **UPDATE** permissions on a table and the **WITH GRANT OPTION** and has granted them to user B, the permissions that user B holds are called dependent permissions. When user A's permission or grant option is revoked, **CASCADE** must be specified to revoke all dependent permissions. A user can only revoke permissions that were granted directly by that user. For example, if user A has granted permission with grant option \(**WITH ADMIN OPTION**\) to user B, and user B has in turn granted it to user C, then user A cannot revoke the permission directly from C. However, user A can revoke the grant option held by user B and use **CASCADE**. In this way, the permission of user C is automatically revoked. For another example, if both user A and user B have granted the same permission to C, A can revoke his own grant but not B's grant, so C will still effectively have the permission. diff --git a/content/en/docs/Developerguide/trigger-functions.md b/content/en/docs/Developerguide/trigger-functions.md index e4fa378e2..c51b96fae 100644 --- a/content/en/docs/Developerguide/trigger-functions.md +++ b/content/en/docs/Developerguide/trigger-functions.md @@ -1,48 +1,51 @@ -# Trigger Functions - -- pg\_get\_triggerdef\(oid\) - - Description: Obtains the definition information of a trigger. - - Parameter: OID of the trigger to be queried - - Return type: text - - Example: - - ``` - postgres=# select pg_get_triggerdef(oid) from pg_trigger; - pg_get_triggerdef - -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func() - CREATE TRIGGER tg03 AFTER INSERT ON gtest26 FOR EACH ROW WHEN ((new.a IS NOT NULL)) EXECUTE PROCEDURE gtest_trigger_func() - (2 rows) - ``` - -- pg\_get\_triggerdef\(oid, boolean\) - - Description: Obtains the definition information of a trigger. - - Parameter: OID of the trigger to be queried and whether it is displayed in pretty mode - - Return type: text - - Example: - - ``` - postgres=# select pg_get_triggerdef(oid,true) from pg_trigger; - pg_get_triggerdef - -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func() - CREATE TRIGGER tg03 AFTER INSERT ON gtest26 FOR EACH ROW WHEN (new.a IS NOT NULL) EXECUTE PROCEDURE gtest_trigger_func() - (2 rows) - - postgres=# select pg_get_triggerdef(oid,false) from pg_trigger; - pg_get_triggerdef - -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func() - CREATE TRIGGER tg03 AFTER INSERT ON gtest26 FOR EACH ROW WHEN ((new.a IS NOT NULL)) EXECUTE PROCEDURE gtest_trigger_func() - (2 rows) - ``` - - +# Trigger Functions + +- pg\_get\_triggerdef\(oid\) + + Description: Obtains the definition information of a trigger. + + Parameter: OID of the trigger to be queried + + Return type: text + + Example: + + ``` + postgres=# select pg_get_triggerdef(oid) from pg_trigger; + pg_get_triggerdef + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func() + CREATE TRIGGER tg03 AFTER INSERT ON gtest26 FOR EACH ROW WHEN ((new.a IS NOT NULL)) EXECUTE PROCEDURE gtest_trigger_func() + (2 rows) + ``` + +- pg\_get\_triggerdef\(oid, boolean\) + + Description: Obtains the definition information of a trigger. + + Parameter: OID of the trigger to be queried and whether it is displayed in pretty mode + + > **NOTE:** + >Boolean parameters take effect only when the WHEN condition is specified during trigger creation. + + Return type: text + + Example: + + ``` + postgres=# select pg_get_triggerdef(oid,true) from pg_trigger; + pg_get_triggerdef + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func() + CREATE TRIGGER tg03 AFTER INSERT ON gtest26 FOR EACH ROW WHEN (new.a IS NOT NULL) EXECUTE PROCEDURE gtest_trigger_func() + (2 rows) + + postgres=# select pg_get_triggerdef(oid,false) from pg_trigger; + pg_get_triggerdef + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + CREATE TRIGGER tg1 BEFORE INSERT ON gtest26 FOR EACH STATEMENT EXECUTE PROCEDURE gtest_trigger_func() + CREATE TRIGGER tg03 AFTER INSERT ON gtest26 FOR EACH ROW WHEN ((new.a IS NOT NULL)) EXECUTE PROCEDURE gtest_trigger_func() + (2 rows) + ``` + + diff --git a/content/en/docs/Developerguide/using-gsql-to-connect-to-a-database.md b/content/en/docs/Developerguide/using-gsql-to-connect-to-a-database.md index 697b40392..b85f07e83 100644 --- a/content/en/docs/Developerguide/using-gsql-to-connect-to-a-database.md +++ b/content/en/docs/Developerguide/using-gsql-to-connect-to-a-database.md @@ -4,7 +4,7 @@ ## Precautions -By default, if a client is idle state after connecting to a database, the client automatically disconnects from the database in the duration specified by **[session\_timeout](security-and-authentication-(postgresql-conf).md#en-us_topic_0237124696_en-us_topic_0059778664_see4820fb6c024e0aa4c56882aeae204a)**. To disable the timeout setting, set **[session\_timeout](security-and-authentication-(postgresql-conf).md#en-us_topic_0237124696_en-us_topic_0059778664_see4820fb6c024e0aa4c56882aeae204a)** to **0**. +By default, if a client is idle state after connecting to a database, the client automatically disconnects from the database in the duration specified by **[session\_timeout](security-and-authentication_postgresql-conf.md#en-us_topic_0237124696_en-us_topic_0059778664_see4820fb6c024e0aa4c56882aeae204a)**. To disable the timeout setting, set **[session\_timeout](security-and-authentication_postgresql-conf.md#en-us_topic_0237124696_en-us_topic_0059778664_see4820fb6c024e0aa4c56882aeae204a)** to **0**. ## Prerequisites @@ -39,7 +39,7 @@ Connection information has been confirmed. For details, see [Confirming Connect **Non-SSL connection** indicates that the database is not connected in SSL mode. If high security is required, [connect to the database in SSL mode](establishing-secure-tcp-ip-connections-in-ssl-mode.md). -3. Change the password after your first login. The initial password is set manually during openGauss database installation. For details, see the _Installation Guide_. You need to change the initial password. Suppose you want to change the initial password to **Mypwd123**. You can use the following command: +3. Change the password after your first login. The initial password is set manually during openGauss database installation. For details, see "**Installing the openGauss** > **Executing Installation**" in the **Installation Guide**. You need to change the initial password. Suppose you want to change the initial password to **Mypwd123**. You can use the following command: ``` postgres=# ALTER ROLE omm IDENTIFIED BY 'Mypwd123' REPLACE 'XuanYuan@2012'; diff --git a/content/zh/docs/Developerguide/CREATE-TYPE.md b/content/zh/docs/Developerguide/CREATE-TYPE.md index 6b54f7d95..ebd299100 100644 --- a/content/zh/docs/Developerguide/CREATE-TYPE.md +++ b/content/zh/docs/Developerguide/CREATE-TYPE.md @@ -232,7 +232,7 @@ postgres=# CREATE TYPE compfoo AS (f1 int, f2 text); postgres=# CREATE TABLE t1_compfoo(a int, b compfoo); postgres=# CREATE TABLE t2_compfoo(a int, b compfoo); postgres=# INSERT INTO t1_compfoo values(1,(1,'demo')); -postgres=# INSERT INTO t2_compfoo select * from t1_typ5; +postgres=# INSERT INTO t2_compfoo select * from t1_compfoo; postgres=# SELECT (b).f1 FROM t1_compfoo; postgres=# SELECT * FROM t1_compfoo t1 join t2_compfoo t2 on (t1.b).f1=(t1.b).f1; diff --git a/content/zh/docs/Developerguide/DROP-TYPE.md b/content/zh/docs/Developerguide/DROP-TYPE.md index f372bb596..70004dc80 100644 --- a/content/zh/docs/Developerguide/DROP-TYPE.md +++ b/content/zh/docs/Developerguide/DROP-TYPE.md @@ -2,7 +2,7 @@ ## 功能描述 -删除一个用户定义的数据类型。只有类型所有者才有删除权限。 +删除一个用户定义的数据类型。superuser、sysadmin及类型所有者才有删除权限。 ## 语法格式 diff --git a/content/zh/docs/Developerguide/PG_ATTRDEF.md b/content/zh/docs/Developerguide/PG_ATTRDEF.md index 9ae06feeb..979cd3164 100644 --- a/content/zh/docs/Developerguide/PG_ATTRDEF.md +++ b/content/zh/docs/Developerguide/PG_ATTRDEF.md @@ -45,7 +45,7 @@ PG\_ATTRDEF系统表存储列的默认值。