diff --git a/content/en/docs/Developerguide/asynchronous-i-o-operations.md b/content/en/docs/Developerguide/asynchronous-i-o-operations.md index 7438a2f771b1e1aff7e4cc2082808efff8fd4357..0935ebd0bd05986a25aceac1e2ed5e07f3ab1d65 100644 --- a/content/en/docs/Developerguide/asynchronous-i-o-operations.md +++ b/content/en/docs/Developerguide/asynchronous-i-o-operations.md @@ -17,7 +17,7 @@ This parameter is a SUSET parameter. Set it based on instructions provided in [ **Parameter description**: Specifies whether to enable the ADIO function. -This parameter is a POSTMASTER parameter. Set it based on instructions provided in [Table 1](resetting-parameters.md#en-us_topic_0237121562_en-us_topic_0059777490_t91a6f212010f4503b24d7943aed6d846). +The current version does not support enabling the asynchronous IO function. By default, this function is disabled. Please do not modify it yourself. **Value range**: Boolean diff --git a/content/en/docs/Developerguide/boolean-data-types.md b/content/en/docs/Developerguide/boolean-data-types.md index 402a3dfd8cc0932ecaff98bde3840997b2dc152f..b979045082bfda4026eae7205aefbdcb7ec23739 100644 --- a/content/en/docs/Developerguide/boolean-data-types.md +++ b/content/en/docs/Developerguide/boolean-data-types.md @@ -27,11 +27,11 @@ Valid literal values for the "true" state include: -TRUE, 't', 'true', 'y', 'yes', and '1' +TRUE, 't', 'true', 'y', 'yes', '1', 1, 'TRUE' Valid literal values for the "false" state include: -FALSE, 'f', 'false', 'n', 'no', and '0' +FALSE, 'f', 'false', 'n', 'no', '0', 'FALSE', false, 0 **TRUE** and **FALSE** are standard expressions, compatible with SQL statements. diff --git a/content/en/docs/Developerguide/mode-matching-operators.md b/content/en/docs/Developerguide/mode-matching-operators.md index 224921443a1d5496bfb0ad9aee8fc91422773d9e..8700cea9090626d00d240028eba76791da67c16f 100644 --- a/content/en/docs/Developerguide/mode-matching-operators.md +++ b/content/en/docs/Developerguide/mode-matching-operators.md @@ -2,56 +2,58 @@ There are three separate approaches to pattern matching provided by the database: the traditional SQL LIKE operator, the more recent SIMILAR TO operator, and POSIX-style regular expressions. Besides these basic operators, functions can be used to extract or replace matching substrings and to split a string at matching locations. -- LIKE - - Description: Determines whether the string matches the mode string following **LIKE**. The LIKE expression returns true if the string matches the supplied pattern. \(As expected, the NOT LIKE expression returns false if LIKE returns true, and vice versa.\) - - Matching rules: - - 1. This operator can succeed only when its pattern matches the entire string. If you want to match a sequence in any position within the string, the pattern must begin and end with a percent sign. - 2. The underscore \(\_\) represents \(matching\) any single character. Percentage \(%\) indicates the wildcard character of any string. - 3. To match a literal underscore or percent sign without matching other characters, the respective character in **pattern** must be preceded by the escape character. The default escape character is the backslash but a different one can be selected by using the **ESCAPE** clause. - 4. To match with escape characters, enter two escape characters. For example: To write a **pattern** constant containing a backslash \(\\\), you need to enter two backslashes in SQL statements. - - > **NOTE:** - >When **standard\_conforming\_strings** is set to **off**, any backslashes you write in literal string constants will need to be doubled. Therefore, writing a pattern matching a single backslash is actually going to write four backslashes in the statement. You can avoid this by selecting a different escape character by using ESCAPE, so that the backslash is no longer a special character of LIKE. But the backslash is still the special character of the character text analyzer, so you still need two backslashes.\) You can also select no escape character by writing **ESCAPE ''**. This effectively disables the escape mechanism, which makes it impossible to turn off the special meaning of underscore and percent signs in the pattern. - - 5. The keyword ILIKE can be used instead of LIKE to make the match case-insensitive. - 6. Operator \~\~ is equivalent to LIKE, and operator \~\~\* corresponds to ILIKE. - - For example: - - ``` - postgres=# SELECT 'abc' LIKE 'abc' AS RESULT; - result - ----------- - t - (1 row) - ``` - - ``` - postgres=# SELECT 'abc' LIKE 'a%' AS RESULT; - result - ----------- - t - (1 row) - ``` - - ``` - postgres=# SELECT 'abc' LIKE '_b_' AS RESULT; - result - ----------- - t - (1 row) - ``` - - ``` - postgres=# SELECT 'abc' LIKE 'c' AS RESULT; - result - ----------- - f - (1 row) - ``` +- LIKE + + Description: Determines whether the string matches the mode string following **LIKE**. The LIKE expression returns true if the string matches the supplied pattern. \(As expected, the NOT LIKE expression returns false if LIKE returns true, and vice versa.\) + + Matching rules: + + 1. This operator can succeed only when its pattern matches the entire string. If you want to match a sequence in any position within the string, the pattern must begin and end with a percent sign. + 2. The underscore \(\_\) represents \(matching\) any single character. Percentage \(%\) indicates the wildcard character of any string. + 3. To match a literal underscore or percent sign without matching other characters, the respective character in **pattern** must be preceded by the escape character. The default escape character is the backslash but a different one can be selected by using the **ESCAPE** clause. + 4. To match with escape characters, enter two escape characters. For example: To write a **pattern** constant containing a backslash \(\\\), you need to enter two backslashes in SQL statements. + + > **NOTE:** + >When **standard\_conforming\_strings** is set to **off**, any backslashes you write in literal string constants will need to be doubled. Therefore, writing a pattern matching a single backslash is actually going to write four backslashes in the statement. You can avoid this by selecting a different escape character by using ESCAPE, so that the backslash is no longer a special character of LIKE. But the backslash is still the special character of the character text analyzer, so you still need two backslashes.\) + > + >When compatible with MYSQL database mode (sql_compatibility = C), you can also select no escape character by writing **ESCAPE ''**. This effectively disables the escape mechanism, which makes it impossible to turn off the special meaning of underscore and percent signs in the pattern. + + 5. The keyword ILIKE can be used instead of LIKE to make the match case-insensitive. + 6. Operator \~\~ is equivalent to LIKE, and operator \~\~\* corresponds to ILIKE. + + For example: + + ``` + postgres=# SELECT 'abc' LIKE 'abc' AS RESULT; + result + ----------- + t + (1 row) + ``` + + ``` + postgres=# SELECT 'abc' LIKE 'a%' AS RESULT; + result + ----------- + t + (1 row) + ``` + + ``` + postgres=# SELECT 'abc' LIKE '_b_' AS RESULT; + result + ----------- + t + (1 row) + ``` + + ``` + postgres=# SELECT 'abc' LIKE 'c' AS RESULT; + result + ----------- + f + (1 row) + ``` - SIMILAR TO @@ -249,7 +251,7 @@ There are three separate approaches to pattern matching provided by the database For example: - + ``` postgres=# SELECT 'abc' ~ 'Abc' AS RESULT; result @@ -257,7 +259,7 @@ There are three separate approaches to pattern matching provided by the database f (1 row) ``` - + ``` postgres=# SELECT 'abc' ~* 'Abc' AS RESULT; result @@ -265,7 +267,7 @@ There are three separate approaches to pattern matching provided by the database t (1 row) ``` - + ``` postgres=# SELECT 'abc' !~ 'Abc' AS RESULT; result @@ -273,7 +275,7 @@ There are three separate approaches to pattern matching provided by the database t (1 row) ``` - + ``` postgres=# SELECT 'abc'!~* 'Abc' AS RESULT; result @@ -281,7 +283,7 @@ There are three separate approaches to pattern matching provided by the database f (1 row) ``` - + ``` postgres=# SELECT 'abc' ~ '^a' AS RESULT; result @@ -289,7 +291,7 @@ There are three separate approaches to pattern matching provided by the database t (1 row) ``` - + ``` postgres=# SELECT 'abc' ~ '(b|d)'AS RESULT; result @@ -297,7 +299,7 @@ There are three separate approaches to pattern matching provided by the database t (1 row) ``` - + ``` postgres=# SELECT 'abc' ~ '^(b|c)'AS RESULT; result @@ -305,7 +307,7 @@ There are three separate approaches to pattern matching provided by the database f (1 row) ``` - + Although most regular expression searches can be executed quickly, regular expressions can still be artificially made up of memory that takes a long time and any amount of memory. It is not recommended that you accept the regular expression search mode from the non-security mode source. If you must do this, you are advised to add the statement timeout limit. The search with the SIMILAR TO mode has the same security risks as the SIMILAR TO provides many capabilities that are the same as those of the POSIX- style regular expression. The LIKE search is much simpler than the other two options. Therefore, it is more secure to accept the non-secure mode source search. diff --git a/content/en/docs/Developerguide/record.md b/content/en/docs/Developerguide/record.md index 35d79dbba2668ecdff7b24b27641e4f3b9c3a36e..9c55c0e07a0c9cc4f492acec4b838360b8c10bff 100644 --- a/content/en/docs/Developerguide/record.md +++ b/content/en/docs/Developerguide/record.md @@ -33,7 +33,7 @@ The above syntax diagram is explained as follows: ## Example ``` -The table used in the following stored procedure is defined as follows: +The table used in the following example is defined as follows: postgres=# \d emp_rec Table "public.emp_rec" Column | Type | Modifiers @@ -47,7 +47,7 @@ postgres=# \d emp_rec comm | numeric(7,2) | deptno | numeric(2,0) | --- Perform array operations in the stored procedure. +-- Perform array operations in the function. postgres=# CREATE OR REPLACE FUNCTION regress_record(p_w VARCHAR2) RETURNS VARCHAR2 AS $$ @@ -105,10 +105,10 @@ END; $$ LANGUAGE plpgsql; --- Invoke the stored procedure. +-- Invoke the function. postgres=# CALL regress_record('abc'); --- Delete the stored procedure. -postgres=# DROP PROCEDURE regress_record; +-- Delete the function. +postgres=# DROP FUNCTION regress_record; ``` diff --git a/content/en/docs/Developerguide/trigger-functions.md b/content/en/docs/Developerguide/trigger-functions.md index 8cdd585482b9b686d1321854dcf414231695077f..e4fa378e2a75e2f078e4e27bc7831b0ad92877b9 100644 --- a/content/en/docs/Developerguide/trigger-functions.md +++ b/content/en/docs/Developerguide/trigger-functions.md @@ -1,21 +1,23 @@ # Trigger Functions -- pg\_get\_triggerdef\(oid\) +- pg\_get\_triggerdef\(oid\) - Description: Obtains the definition information of a trigger. + Description: Obtains the definition information of a trigger. - Parameter: OID of the trigger to be queried + Parameter: OID of the trigger to be queried - Return type: text + Return type: text - Example: + Example: - ``` - postgres=# SELECT pg_get_triggerdef(oid) FROM pg_trigger; - pg_get_triggerdef - ---------------------------------------------------------------------------------------------------------------------- - (0 rows) - ``` + ``` + 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\) @@ -28,10 +30,19 @@ Example: ``` - postgres=# SELECT pg_get_triggerdef(oid, true) FROM pg_trigger; - pg_get_triggerdef - ---------------------------------------------------------------------------------------------------------------------- - (0 rows) + 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/Toolreference/command-reference-1.md b/content/en/docs/Toolreference/command-reference-1.md index 55e03ef5d80bd708c4ffa921901a28a6276cacc2..51762d5548060d43a0dd890621a6e046aef5e94a 100644 --- a/content/en/docs/Toolreference/command-reference-1.md +++ b/content/en/docs/Toolreference/command-reference-1.md @@ -60,7 +60,7 @@
The node naming convention is as follows: