Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Platform and Client Compatibility

Updated on 2025-02-27 GMT+08:00

Many platforms use the database system. External compatibility of the database system provides a lot of convenience for platforms.

convert_string_to_digit

Parameter description: Specifies the implicit conversion priority, which determines whether to preferentially convert strings into numbers.

This is a USERSET parameter. Set it based on instructions in Table 1.

Value range: Boolean

  • on indicates that strings are preferentially converted into numbers.
  • off indicates that strings are not preferentially converted into numbers.

Default value: on

NOTICE:

Adjusting this parameter will change the internal data type conversion rule and cause unexpected behaviors. Exercise caution when performing this operation.

nls_timestamp_format

Parameter description: Specifies the default timestamp format.

This is a USERSET parameter. Set it based on instructions in Table 1.

Value range: a string

Default value: DD-Mon-YYYY HH:MI:SS.FF AM

max_function_args

Parameter description: Specifies the maximum number of parameters allowed for a function.

This is a fixed parameter of the INTERNAL type. It can be viewed but cannot be modified.

Value range: an integer

Default value: 8192

transform_null_equals

Parameter description: Specifies whether expressions of the form expr = NULL (or NULL = expr) are treated as expr IS NULL. They return true if expr evaluates to the NULL value, and false otherwise.

  • The correct SQL-standard-compliant behavior of expr = NULL is to always return NULL (unknown).
  • Filtered forms in Microsoft Access generate queries that appear to use expr = NULL to test for null values. If you turn this option on, you can use this interface to access the database.

This is a USERSET parameter. Set it based on instructions in Table 2.

Value range: Boolean

  • on indicates that expressions of the form expr = NULL (or NULL = expr) are treated as expr IS NULL.
  • off indicates that expr = NULL always returns NULL (unknown).

Default value: off

NOTE:

New users are always confused about the semantics of expressions involving NULL values. Therefore, off is used as the default value.

support_extended_features

Parameter description: Specifies whether extended database features are supported.

This is a POSTMASTER parameter. Set it based on instructions in Table 2.

Value range: Boolean

  • on indicates that extended database features are supported.
  • off indicates that extended database features are not supported.

Default value: off

sql_compatibility

Parameter description: Specifies the type of mainstream database with which the SQL syntax and statement behavior of the database is compatible. This parameter is an INTERNAL parameter. It can be viewed but cannot be modified.

Value range: enumerated type

  • A indicates that the database is compatible with the Oracle database.
  • B indicates that the database is compatible with the MySQL database.
  • C indicates that the database is compatible with the Teradata database.
  • PG indicates that the database is compatible with the PostgreSQL database.

Default value: A

NOTICE:
  • This parameter can be set only when you run the CREATE DATABASE command to create a database.
  • In the database, this parameter must be set to a specific value. It can be set to A or B and cannot be changed randomly. Otherwise, the setting is not consistent with the database behavior.

behavior_compat_options

Parameter description: Specifies database compatibility behavior. Multiple items are separated by commas (,).

This is a USERSET parameter. Set it based on instructions in Table 1.

Value range: a string

Default value: ""

NOTE:
  • Currently, only items in Table 1 are supported.
  • Multiple items are separated by commas (,), for example, set behavior_compat_options='end_month_calculate,display_leading_zero';.
Table 1 Compatibility configuration items

Configuration Item

Behavior

display_leading_zero

Specifies how floating point numbers are displayed. It controls the display of zeros before the decimal point of all character string types (such as char, character, nchar, varchar, character varying, varchar2, nvarchar2, text, and clob) and any precision types (such as float4, float8, and numeric) in the numeric type. In addition, the length of the calculated number is displayed synchronously.

  • If this item is not specified, for a decimal number between –1 and 1, the 0 before the decimal point is not displayed. For example:
    1
    2
    3
    4
    5
    openGauss=# 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)
    
  • If this item is specified, for a decimal number between –1 and 1, the 0 before the decimal point is displayed. For example:
    1
    2
    3
    4
    5
    openGauss=# 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

Specifies the calculation logic of the add_months function.

Assume that the two parameters of the add_months function are param1 and param2, and that the month of param1 and param2 is result.

  • If this item is not specified, and the Day of param1 indicates the last day of a month shorter than result, the Day in the calculation result will equal that in param1. For example:
    1
    2
    3
    4
    5
    openGauss=# select add_months('2018-02-28',3) from sys_dummy;
    add_months
    ---------------------
    2018-05-28 00:00:00
    (1 row)
    
  • If this item is specified, and the Day of param1 indicates the last day of a month shorter than result, the Day in the calculation result will equal that in result. For example:
    1
    2
    3
    4
    5
    openGauss=# select add_months('2018-02-28',3) from sys_dummy;
    add_months
    ---------------------
    2018-05-31 00:00:00
    (1 row)
    

compat_analyze_sample

Specifies the sampling behavior of the ANALYZE operation.

If this item is specified, the sample collected by the ANALYZE operation will be limited to around 30,000 records, controlling database node memory consumption and maintaining the stability of ANALYZE.

bind_schema_tablespace

Binds a schema with the tablespace with the same name.

If a tablespace name is the same as sche_name, default_tablespace will also be set to sche_name if search_path is set to sche_name.

bind_procedure_searchpath

Specifies the search path of the database object in a stored procedure for which no schema name is specified.

If no schema name is specified for a stored procedure, the search is performed in the schema to which the stored procedure belongs.

If the stored procedure is not found, the following operations are performed:

  • If this item is not specified, the system reports an error and exits.
  • If this item is specified, the search continues based on the settings of search_path. If the issue persists, the system reports an error and exits.

correct_to_number

Specifies the compatibility of the to_number() result.

If this item is not set, the result of the to_number() function is the same as that in the A database by default.

1
2
3
openGauss=# select '' AS to_number_14, to_number('34,50','999,99');
ERROR:  invalid data.
CONTEXT:  referenced column: to_number

If this item is set, the result of the to_number() function is the same as that of pg11.

1
2
3
4
5
openGauss=# select '' AS to_number_14, to_number('34,50','999,99');
 to_number_14 | to_number
--------------+-----------
              |      3450
(1 row)

unbind_divide_bound

Specifies the range check on the result of integer division.

If this item is not set, the range of the division result is verified. For example, an out-of-bounds error is reported because the output result of INT_MIN/(-1) is greater than INT_MAX.

1
2
openGauss=# select (-2147483648)::int4 / (-1)::int4;
ERROR:  integer out of range

If this item is set, the range of the division result does not need to be verified. For example, the output result of INT_MIN/(-1) is INT_MAX+1.

1
2
3
4
5
openGauss=# select (-2147483648)::int4 / (-1)::int4;
  ?column?  
------------
 2147483648
(1 row)

convert_string_digit_to_numeric

Determines whether to convert numeric constants of the character string type to those of the numeric type before these two types are compared.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
openGauss=# create table test1 (c1 int, c2 varchar);
openGauss=# insert into test1 values (2, '1.1');
openGauss=# set behavior_compat_options='';
openGauss=# select * from test1 where c2 > 1;
ERROR:  invalid input syntax for type bigint: "1.1"

openGauss=# set behavior_compat_options='convert_string_digit_to_numeric';
openGauss=# select * from test1 where c2 > 1;
 c1 | c2  
----+-----
  2 | 1.1 
(1 row)

return_null_string

Specifies how to display the empty result (empty string '') of the lpad() and rpad() functions.

  • If this item is not specified, the empty string is displayed as NULL.
1
2
3
4
5
openGauss=# select length(lpad('123',0,'*')) from sys_dummy;
length
--------

(1 row)
  • If this item is specified, the empty string is displayed as '0'.
1
2
3
4
5
openGauss=# select length(lpad('123',0,'*')) from sys_dummy;
length
--------
0
(1 row)

compat_concat_variadic

Specifies the compatibility of variadic results of the concat() and concat_ws() functions. The B database does not have the variadic type. Therefore, this option has no impact on the B database.

If this item is not set and the concat function parameter is of the variadic type, the results of the A and C databases in compatibility mode are the same by default.

1
2
3
4
5
openGauss=# select concat(variadic NULL::int[]) is NULL;
 ?column? 
----------
 t
(1 row)

If this item is set and the concat function parameter is of the variadic type, different result formats of the A and C databases in compatibility mode are retained.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
--In the A database:
openGauss=# select concat(variadic NULL::int[]) is NULL;
 ?column? 
----------
 t
(1 row)
--In the C database:
openGauss=# select concat(variadic NULL::int[]) is NULL;
 ?column? 
----------
 f
(1 row)

merge_update_multi

When MERGE INTO... When WHEN MATCHED THEN UPDATE (see "SQL Reference" > "SQL Syntax" > "MERGE INTO" in Developer Guide) and INSERT ... ON DUPLICATE KEY UPDATE (see "SQL Reference" > "SQL Syntax" > INSERT" in Developer Guide) are used, it controls the UPDATE behavior if a piece of target data in the target table conflicts with multiple pieces of source data.

If this item is specified and the preceding scenario exists, the system performs multiple UPDATE operations on the conflicting row. If this item is not specified and the preceding scenario exists, an error is reported, that is, the MERGE or INSERT operation fails.

plstmt_implicit_savepoint

Determines whether the execution of an UPDATE statement in a stored procedure has an independent subtransaction.

If this parameter is set, the implicit savepoint is enabled before executing each UPDATE statement in the stored procedure, and the subtransaction is rolled backed to the latest savepoint in the EXCEPTION block by default, ensuring that only the modification of failed statements is rolled back. This option is used to be compatible with the EXCEPTION behavior of the O database.

hide_tailing_zero

Configuration item for numeric display. If this parameter is not set, numeric values are displayed based on the specified precision. If this parameter is set, all numeric values are output with trailing zeros (after a decimal point) hidden, including the scenario where the format precision is explicitly specified.

For example:

openGauss=# set behavior_compat_options='hide_tailing_zero';
openGauss=# 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)
openGauss=# set behavior_compat_options='';
openGauss=# 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

Specifies the ROWNUM type. The default value is BIGINT. After this parameter is specified, the value is changed to NUMERIC.

openGauss=# set behavior_compat_options='';
openGauss=# create table tb_test(c1 int,c2 varchar2,c3 varchar2);
openGauss=# insert into tb_test values(1,'a','b');
openGauss=# create or replace view v_test as select rownum from tb_test;
openGauss=# \d+ v_test
                View "public.v_test"
 Column |  Type  | Modifiers | Storage | Description 
--------+--------+-----------+---------+-------------
 rownum | bigint |           | plain   | 
View definition:
 SELECT ROWNUM AS "rownum"
   FROM tb_test;

openGauss=# set behavior_compat_options = 'rownum_type_compat';
openGauss=# create or replace view v_test1 as select rownum from tb_test;
openGauss=# \d+ v_test1
                View "public.v_test1"
 Column |  Type   | Modifiers | Storage | Description 
--------+---------+-----------+---------+-------------
 rownum | numeric |           | main    | 
View definition:
 SELECT ROWNUM AS "rownum"
   FROM tb_test;

aformat_null_test

Specifies the logic for checking whether rowtype is not null.

When this parameter is set, if one column in a row is not empty, true is returned for checking whether rowtype is not null. When this parameter is not set, if all columns in a row are not empty, true is returned for checking whether rowtype is not null. This parameter has no influence on checking whether rowtype is not null.

openGauss=# set behavior_compat_options='aformat_null_test';
openGauss=# select r, r is null as isnull, r is not null as isnotnull from (values (1,row(1,2)), (1,row(null,null)), (1,null), (null,row(1,2)), (null,row(null,null)), (null,null) ) r(a,b);
      r      | isnull | isnotnull 
-------------+--------+-----------
 (1,"(1,2)") | f      | t
 (1,"(,)")   | f      | t
 (1,)        | f      | t
 (,"(1,2)")  | f      | t
 (,"(,)")    | f      | t
 (,)         | t      | f
(6 rows)
openGauss=# set behavior_compat_options='';
openGauss=# select r, r is null as isnull, r is not null as isnotnull from (values (1,row(1,2)), (1,row(null,null)), (1,null), (null,row(1,2)), (null,row(null,null)), (null,null) ) r(a,b);
      r      | isnull | isnotnull 
-------------+--------+-----------
 (1,"(1,2)") | f      | t
 (1,"(,)")   | f      | t
 (1,)        | f      | f
 (,"(1,2)")  | f      | f
 (,"(,)")    | f      | f
 (,)         | t      | f
(6 rows)

aformat_regexp_match

Determines the matching behavior of regular expression functions.

When this parameter is set and sql_compatibility is set to A or B, the options supported by the flags parameter of the regular expression are changed as follows:
  1. By default, the character '\n' cannot be matched.
  2. If flags contains the n option, the period (.) can match the '\n' character.
  3. The regexp_replace(source, pattern replacement) function replaces all matching substrings.
  4. regexp_replace(source, pattern, replacement, flags) returns null when the value of flags is '' or null.

Otherwise, the meanings of the options supported by the flags parameter of the regular expression are as follows:

  1. By default, the character '\n' can be matched.
  2. The n option in flags indicates that the multi-line matching mode is used.
  3. The regexp_replace(source, pattern replacement) function replaces only the first matched substring.
  4. If the value of flags is '' or null, the return value of regexp_replace(source, pattern, replacement, flags) is the character string after replacement.

compat_cursor

Determines the compatibility behavior of implicit cursor states. If this parameter is set and the O compatibility mode is used, the effective scope of implicit cursor states (SQL%FOUND, SQL%NOTFOUND, SQL%ISOPNE, and SQL%ROWCOUNT) are extended from only the currently executed function to all subfunctions invoked by this function.

proc_outparam_override

Determines the overloading of output parameters of a stored procedure. After this parameter is enabled, the stored procedure can be properly created and invoked even if only the output parameters of the stored procedure are different. Currently, this parameter can be used only when gsql and JDBC are used to connect to the database. If this parameter is enabled for other tools to connect to the database, stored procedures with the output parameters cannot be invoked.

proc_implicit_for_loop_variable

Determines the behavior of the FOR_LOOP query statement in a stored procedure. When this parameter is set, if rec has been defined in the FOR rec IN query LOOP statement, the defined rec variable is not reused and a new variable is created. Otherwise, the defined rec variable is reused and no new variable is created.

allow_procedure_compile_check

Controls the compilation check of the SELECT and OPEN CURSOR statements in a stored procedure. If this parameter is set, when the SELECT, OPEN CURSOR FOR, CURSOR%rowtype, or for rec in statement is executed in a stored procedure, the stored procedure cannot be created if the queried table does not exist, and the compilation check of the trigger function is not supported. If the queried table exists, the stored procedure is successfully created.

char_coerce_compat

Determines the behavior when char(n) types are converted to other variable-length string types. If this parameter is not set, spaces at the end are omitted when the char(n) type is converted to other variable-length string types. After this parameter is set, spaces at the end are not omitted during conversion. In addition, if the length of the char(n) type exceeds the length of other variable-length string types, an error is reported. This parameter is valid only when the sql_compatibility parameter is set to A. After this parameter is enabled, spaces at the end are not omitted in implicit conversion, explicit conversion, or conversion by calling the text(bpchar) function.

openGauss=# set behavior_compat_options='';
openGauss=# create table tab_1(col1 varchar(3)); 
openGauss=# create table tab_2(col2 char(3));
openGauss=# insert into tab_2 values('   ');
openGauss=# insert into tab_1 select col2 from tab_2;
openGauss=# select * from tab_1 where col1 is null;
 col1 
------
 
(1 row)
openGauss=# select * from tab_1 where col1='   ';
 col1 
------
(0 rows)
openGauss=# delete from tab_1;
openGauss=# set behavior_compat_options = 'char_coerce_compat';
openGauss=# insert into tab_1 select col2 from tab_2;
openGauss=# select * from tab_1 where col1 is null;
 col1 
------
(0 rows)
openGauss=# select * from tab_1 where col1='   ';
 col1 
------
    
(1 row)

truncate_numeric_tail_zero

Configuration item for numeric display. If this parameter is not specified, numeric values are displayed based on the default precision. If this parameter is specified, the last 0 after the decimal point is hidden in all numeric output scenarios except to_char(numeric, format). For example:

openGauss=#set behavior_compat_options='truncate_numeric_tail_zero';
openGauss=#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)
openGauss=#set behavior_compat_options='';
openGauss=#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)

plsql_security_definer

After this parameter is enabled, the definer permission is used by default when a stored procedure is created.

array_count_compat

Controls the array.count function. If the parameter is enabled, the function returns 0. Otherwise, the function returns NULL.

disable_emptystr2null

If this parameter is enabled, the function of converting empty strings to null by default is disabled for the following character types: text, clob, blob, raw, bytea, varchar, nvarchar2, bpchar, char, name, byteawithoutorderwithqualcol, and byteawithoutordercol. This parameter is reserved for emergency. Do not set it unless necessary.

proc_uncheck_default_param

When a function is called, the system does not check whether the default parameter is omitted.

  • If this item is not set and a function with default parameters is invoked, input parameters are added to the function from left to right. If inputs of non-default parameters are missing, an error is reported. For example:
    openGauss=# create or replace function test(f1 int, f2 int default 20, f3 int, f4 int default 40, f5 int default 50) return int
    openGauss-# as
    openGauss$# begin
    openGauss$# raise info 'f1:%',f1;
    openGauss$# raise info 'f2:%',f2;
    openGauss$# raise info 'f3:%',f3;
    openGauss$# raise info 'f4:%',f4;
    openGauss$# raise info 'f5:%',f5;
    openGauss$# return 1;
    openGauss$# end;
    openGauss$# /
    CREATE FUNCTION
    openGauss=# select test(1,2);
    ERROR:  function test(integer, integer) does not exist
    LINE 1: select test(1,2);
                   ^
    HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
    CONTEXT:  referenced column: test
  • If this item is set and a function with default parameters is invoked, input parameters are added to the function from left to right. The number of defaulted inputs depends on the number of default parameters. If an input of a non-default parameter is missing, the previous default value is used to fill this parameter. For example:
    openGauss=# create or replace function test(f1 int, f2 int default 20, f3 int, f4 int default 40, f5 int default 50) return int
    openGauss-# as
    openGauss$# begin
    openGauss$# raise info 'f1:%',f1;
    openGauss$# raise info 'f2:%',f2;
    openGauss$# raise info 'f3:%',f3;
    openGauss$# raise info 'f4:%',f4;
    openGauss$# raise info 'f5:%',f5;
    openGauss$# return 1;
    openGauss$# end;
    openGauss$# /
    CREATE FUNCTION
    openGauss=# select test(1,2);
    INFO:  f1:1
    CONTEXT:  referenced column: test
    INFO:  f2:2
    CONTEXT:  referenced column: test
    INFO:  f3:20
    CONTEXT:  referenced column: test
    INFO:  f4:40
    CONTEXT:  referenced column: test
    INFO:  f5:50
    CONTEXT:  referenced column: test
     test 
    ------
        1
    (1 row)

    As shown above, f3 is filled with an incorrect default value.

    WARNING:

    In this scenario, a non-default parameter is filled with the previous default value.

plsql_rollback_keep_user

Determines whether ROLLBACK and ROLLBACK TO SAVEPOINT in PL/SQL rolls back the current user. If this parameter is enabled, ROLLBACK in the PL/SQL does not change the current user.

Example:
openGauss=# CREATE USER plsql_rollback1 password 'huawei@123';
openGauss=# CREATE USER plsql_rollback2 password 'huawei@123';
openGauss=# GRANT plsql_rollback1 to plsql_rollback2;
openGauss=# CREATE OR REPLACE procedure plsql_rollback1.p1 () authid definer
openGauss-# as
openGauss$# va int;
openGauss$# begin
openGauss$# raise info 'current usr:%', current_user;
openGauss$# rollback;
openGauss$# raise info 'current usr:%', current_user;
openGauss$# end;
openGauss$# /
CREATE PROCEDURE
openGauss=# SET session AUTHORIZATION plsql_rollback2 PASSWORD 'huawei@123';
SET
openGauss=> SET behavior_compat_options = 'plsql_rollback_keep_user';
SET
openGauss=> CALL plsql_rollback1.p1 ();
INFO:  current usr:plsql_rollback1
INFO:  current usr:plsql_rollback1
p1
----

(1 row)
CAUTION:

This parameter is valid only in the A compatibility mode.

dynamic_sql_check

After the parameter is enabled, the number of template parameters in the template SQL statement is compared with the number of variables in the USING clause. If they are inconsistent, an error is reported.

openGauss=# create table tb_t1(col1 varchar2,col2 varchar2,col3 varchar2);
CREATE TABLE
openGauss=# insert into tb_t1 select '1','1','2';
INSERT 0 1
openGauss=# create or replace procedure proc_test()as
openGauss$# v_a varchar2;
openGauss$# v_b varchar2;
openGauss$# v_cnt int;
openGauss$# v_sql varchar2;
openGauss$# begin
openGauss$# v_a = '1';
openGauss$# v_b = '2';
openGauss$# v_sql = 'select count(1) from tb_t1 where col1 = :va and col2 = :va and col3 = :vb;';
openGauss$# execute immediate v_sql into v_cnt using v_a,v_a,v_b;
openGauss$# raise info 'v_cnt:%',v_cnt;
openGauss$# end;
openGauss$# /
CREATE PROCEDURE
openGauss=# call proc_test();
INFO:  v_cnt:0
 proc_test 
-----------
(1 row)
openGauss=# set behavior_compat_options='dynamic_sql_check';
SET
openGauss=# call proc_test();
ERROR:  argnum not match in Dynamic SQL, using args num : 3 , actual sql args num : 2
CONTEXT:  SQL statement "select count(1) from tb_t1 where col1 = :va and col2 = :va and col3 = :vb;"
PL/SQL function proc_test() line 10 at EXECUTE statemen
CAUTION:

If the dynamic_sql_compat option is enabled, the dynamic_sql_check option does not take effect.

plsql_compile_check_options

Parameter description: Specifies database compatibility behavior. Multiple items are separated by commas (,).

This is a USERSET parameter. Set it based on instructions in Table 1.

Value range: a string

Default value: ""

NOTE:
  • Currently, only items in Table 1 are supported.
  • Multiple items are separated by commas (,), for example, set plsql_compile_check_options='for_loop,outparam';.
Table 2 Compatibility configuration items

Configuration Item

Behavior

for_loop

Determines the behavior of the FOR_LOOP query statement in a stored procedure. When this parameter is set, if rec has been defined in the FOR rec IN query LOOP statement, the defined rec variable is not reused and a new variable is created. Otherwise, the defined rec variable is reused and no new variable is created. (It is the same as proc_implicit_for_loop_variable and will be incorporated later.)

outparam

When the output parameter overloading condition is met, the output parameters are checked. The output parameters cannot be constant.

a_format_version

Parameter description: Specifies the database platform compatibility configuration item. The value of this parameter is an enumerated string.

This is a USERSET parameter. Set it based on instructions in Table 1.

Value range: a string

Default value: ""

NOTE:
  • Currently, only items in Table 1 are supported.
  • Set a character string for the compatibility configuration item, for example, set a_format_version='10c'.
Table 3 Compatibility configuration items

Configuration Item

Compatibility Behavior Control

10c

Compatible version of platform A

a_format_dev_version

Parameter description: Specifies the database platform minor version compatibility configuration item. The value of this parameter is an enumerated string.

This is a USERSET parameter. Set it based on instructions in Table 1.

Value range: a string

Default value: ""

NOTE:
  • Currently, only items in Table 1 are supported.
  • Set a character string for the compatibility configuration item, for example, set a_format_dev_version='s1'.
Table 4 Compatibility configuration items

Configuration Item

Compatibility Behavior Control

s1

After this parameter is enabled, the int casted from text can be rounded off.

plpgsql.variable_conflict

Parameter description: Sets the priority of using stored procedure variables and table columns with the same name.

This is a USERSET parameter. Set it based on instructions in Table 2.

Value range: a string

  • error indicates that a compilation error is reported when the name of a stored procedure variable is the same as that of a table column.
  • use_variable indicates that if the name of a stored procedure variable is the same as that of a table column, the variable is used preferentially.
  • use_column indicates that if the name of a stored procedure variable is the same as that of a table column, the column name is used preferentially.

Default value: error

td_compatible_truncation

Parameter description: Specifies whether to enable features compatible with a Teradata database. You can set this parameter to on when connecting to a database compatible with the Teradata database, so that when you perform the INSERT operation, overlong strings are truncated based on the allowed maximum length before being inserted into char- and varchar-type columns in the target table. This ensures all data is inserted into the target table without errors reported.

NOTE:

The string truncation function cannot be used if the INSERT statement includes a foreign table.

If inserting multi-byte character data (such as Chinese characters) to database with the character set byte encoding (such as SQL_ASCII or LATIN1), and the character data crosses the truncation position, the string is truncated based on its bytes instead of characters. Unexpected result will occur in tail after the truncation. If you want correct truncation result, you are advised to adopt encoding set such as UTF8, which has no character data crossing the truncation position.

This is a USERSET parameter. Set it based on instructions in Table 2.

Value range: Boolean

  • on indicates that overlong strings are truncated.
  • off indicates that overlong strings are not truncated.

Default value: off

uppercase_attribute_name

Parameter description: Specifies whether to return column names in uppercase to the client. This parameter is used only in the ORA-compatible mode and centralized environment.

This is a USERSET parameter. Set it based on instructions in Table 2.

Value range: Boolean

  • on indicates that column names are returned to the client in uppercase.
  • off indicates that column names are not returned to the client in uppercase.

Default value: off

lastval_supported

Parameter description: Specifies whether the lastval function can be used.

This is a POSTMASTER parameter. Set it based on instructions in Table 1.

Value range: Boolean

  • on indicates that the lastval function can be used and the nextval function cannot be pushed down.
  • off indicates that the lastval function cannot be used and the nextval function can be pushed down.

Default value: off

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback