Updated on 2024-05-07 GMT+08:00

Platform and Client Compatibility

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

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 parameter is a USERSET parameter. Set it based on instructions provided in Table 1.

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

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

support_extended_features

Parameter description: Specifies whether extended database features are supported.

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

Value range: Boolean

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

Default value: off

lastval_supported

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

This parameter is a POSTMASTER parameter. Set it based on instructions provided 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

group_concat_max_len

Parameter description: This parameter is used together with the GROUP_CONCAT function to limit the length of the return value. If the length exceeds the limit, the exceeded part of the return value is truncated. However, the distributed does not support the GROUP_CONCAT function. Therefore, this function can be set but has no actual effect.

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

Value range: 0 to 9223372036854775807

Default value: 1024

sql_compatibility

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

Value range: enumerated values

  • ORA indicates that the SQL syntax and statement behavior of the database is compatible with the Oracle database.
  • TD indicates that the SQL syntax and statement behavior of the database is compatible with the Teradata database.
  • MYSQL indicates that the SQL syntax and statement behavior of the database is compatible with the MySQL database.
  • PG indicates that the database is compatible with the PostgreSQL database.

Default value: MYSQL

  • This parameter can be set only when you run the CREATE DATABASE command to create a database. For details, see "SQL Reference > SQL Syntax > CREATE DATABASE" in the Developer Guide.
  • In the database, this parameter must be set to a specific value. It can be set to ORA or TD 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 parameter is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: a string

Default value: ""

  • Currently, only items in Platform and Client Compatibility 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

Compatibility 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
    gaussdb=# 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
    gaussdb=# 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
gaussdb=# 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
gaussdb=# 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 CN 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

Controls 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 ORA database by default.

1
2
3
gaussdb=# 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
gaussdb=# select '' AS to_number_14, to_number('34,50','999,99');
 to_number_14 | to_number
--------------+-----------
              |      3450
(1 row)

unbind_divide_bound

Controls 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
gaussdb=# 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
gaussdb=# 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
gaussdb=# create table test1 (c1 int, c2 varchar);
gaussdb=# insert into test1 values (2, '1.1');
gaussdb=#  set behavior_compat_options='';
gaussdb=#  select * from test1 where c2 > 1;
ERROR:  invalid input syntax for type bigint: "1.1"

gaussdb=#  set behavior_compat_options='convert_string_digit_to_numeric';
gaussdb=#  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
gaussdb=# select length(lpad('123',0,'*')) from sys_dummy;
length
--------

(1 row)
  • If this item is specified, the empty string is displayed as single quotation marks ('').
1
2
3
4
5
gaussdb=# 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 MYSQL database does not have the variadic type. Therefore, this option has no impact on the MY database.

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

1
2
3
4
5
gaussdb=# 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 ORA and TD databases in compatibility mode are retained.

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

merge_update_multi

When MERGE INTO ... 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 to_char(numeric, format) scenario.

For example:

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

char_coerce_compat

Specifies the behavior when the char(n) type is 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. If 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 ORA. 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.

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

truncate_numeric_tail_zero

Configuration item for numeric display. If this parameter is not set, numeric values are displayed based on the default precision. If this parameter is set, all numeric values are output with trailing zeros (after a decimal point) hidden, except for to_char(numeric, format). For example:

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

plpgsql_dependency

If this parameter is set, a function or stored procedure containing undefined objects can be created. You can query the dependency in GS_DEPENDENCIES and GS_DEPENDENCIES_OBJ.

If this parameter is enabled, when creating a PL/SQL object, the OID that depends on the PL/SQL object is automatically updated.

Dependency can be established in the following scenarios:

  1. A function appears at the position of the dependency type and parameter default value in a function header.
  2. Type in the function and variable dependency type.
  3. In the function body, function A is called in the right value expression of the function call or assignment statement. If the input and output parameters of function A contain function B, no dependency is established for function B. For example, functionA(functionB()). Only the dependency for function A is established.
  4. Dependency function in a view.

Dependency cannot be established in the following scenarios:

  1. A type in a schema depends on other types.
  2. Dependency on functions, variables, tables, and views in SQL statements.

    For example, dependency is not recorded for select id into var1 from table1 join view1 on table1.id = pkg1.var1; table1,view1,pkg1.

  3. Dependency on functions, variables, tables, and views in a view.

Notes:

  1. When PL/SQL objects are concurrently created, deadlocks may occur if competition occurs among the object.
  2. If the objects to be modified exist in gs_dependencies and gs_dependencies_obj, you cannot rename the objects.
  3. When a function, stored procedure, or package depends on a synonym, the synonym must be created in advance. OIDs cannot be maintained manually.

disable_rewrite_nesttable

The distributed mode does not support this parameter.

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 out parameter cannot be invoked.

It supports the functions that contain the out output parameter and returns data of the record type. Besides, a value is assigned to the out parameter.

aformat_regexp_match

Determines the matching behavior of regular expression functions.

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

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

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

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.

select_into_return_null

This parameter is invalid in distributed mode.

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:
    gaussdb=# create or replace function test(f1 int, f2 int default 20, f3 int, f4 int default 40, f5 int default 50) return int
    gaussdb-# as
    gaussdb$# begin
    gaussdb$# raise info 'f1:%',f1;
    gaussdb$# raise info 'f2:%',f2;
    gaussdb$# raise info 'f3:%',f3;
    gaussdb$# raise info 'f4:%',f4;
    gaussdb$# raise info 'f5:%',f5;
    gaussdb$# return 1;
    gaussdb$# end;
    gaussdb$# /
    CREATE FUNCTION
    gaussdb=# 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:
    gaussdb=# create or replace function test(f1 int, f2 int default 20, f3 int, f4 int default 40, f5 int default 50) return int
    gaussdb-# as
    gaussdb$# begin
    gaussdb$# raise info 'f1:%',f1;
    gaussdb$# raise info 'f2:%',f2;
    gaussdb$# raise info 'f3:%',f3;
    gaussdb$# raise info 'f4:%',f4;
    gaussdb$# raise info 'f5:%',f5;
    gaussdb$# return 1;
    gaussdb$# end;
    gaussdb$# /
    CREATE FUNCTION
    gaussdb=# 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.

dynamic_sql_compat

After this parameter is enabled, the dynamic statement does not consider the template parameters with the same name in the template SQL statement as the same variable. Instead, the variables in the USING clause are matched in sequence.

CAUTION:
  • If a stored procedure is invoked when a dynamic statement executes an anonymous block statement, only the IN parameters are corrected. If OUT parameters need to be checked, set the proc_outparam_override parameter.
  • If a stored procedure is invoked when a dynamic statement executes an anonymous block statement and the parameter is enabled, the IN and OUT attributes in a stored procedure and the USING clause are not checked.

dynamic_sql_check

If this parameter is enabled, an error is reported during dynamic statement execution if the number of different template parameters in the dynamic statement template SQL is different from the number of variables in the USING clause.

CAUTION:
  • If the dynamic_sql_compat option is enabled, the dynamic_sql_check option does not take effect.
  • If a stored procedure is invoked when a dynamic statement executes an anonymous block statement, only the IN parameters are checked. If OUT parameters need to be checked, set the proc_outparam_override parameter.
  • If a stored procedure is invoked when a dynamic statement executes an anonymous block statement and the parameter is enabled, the IN and OUT attributes in a stored procedure and the USING clause are not checked.

enable_funcname_with_argsname

If the parameter is enabled, the projection alias displays the complete function when the SELECT function is invoked.

  • If this item is not set, the projection alias displays the function name when the SELECT function is invoked. For example:
    gaussdb=# SELECT power(2,3);
     power 
    -------
         8
    (1 row)
    
    gaussdb=# SELECT count(*) FROM db_ind_columns;
     count 
    -------
       611
    (1 row)
    
    gaussdb=# SELECT count(index_name) FROM db_ind_columns;
     count 
    -------
       611
    (1 row)
    
    gaussdb=# SELECT left('abcde', 2);
     left 
    ------
     ab
    (1 row)
    
    gaussdb=# SELECT pg_client_encoding();
     pg_client_encoding 
    --------------------
     UTF8
    (1 row)
  • If the item is set, the projection alias displays the complete function when the SELECT function is invoked. For example:
    gaussdb=# SET behavior_compat_options = 'enable_funcname_with_argsname';
    SET
    gaussdb=# SELECT power(2,3);
     power(2,3) 
    ------------
              8
    (1 row)
    
    gaussdb=# SELECT count(*) FROM db_ind_columns;
     count(*) 
    ----------
          611
    (1 row)
    
    gaussdb=# SELECT count(index_name) FROM db_ind_columns;
     count(index_name) 
    -------------------
                   611
    (1 row)
    
    gaussdb=# SELECT left('abcde', 2);
     left('abcde',2) 
    -----------------
     ab
    (1 row)
    
    gaussdb=# SELECT pg_client_encoding();
     pg_client_encoding() 
    ----------------------
     UTF8
    (1 row)
    CAUTION:
    • Currently, only func_name(args_list), func_name(), and func_name(*) are supported to display complete functions. The args parameter only supports character type, value type, column name, and function. A function name can contain a schema or package name. The parameter cannot contain other clauses (such as the ORDER BY clause) or be an expression. The parameter can contain only the DISTINCT keyword. If the parameter contains other keywords, the complete function cannot be displayed.
    • Some special functions do not support displaying projection alias, including COLLATION FOR, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, DBTIMEZONE, LOCALTIME, LOCALTIMESTAMP, SYSDATE, SESSIONTIMEZONE, ROWNUM, CURRENT_ROLE, CURRENT_USER, SESSION_USER, USER, CURRENT_CATALOG, CURRENT_SCHEMA, CAST, EXTRACT, TIMESTAMPDIFF, OVERLAY, POSITION, SUBSTRING, TREAT, TRIM, NULLIF, NVL, NVL2, COALESCE, GREATEST, LEAST, LNNVL, REGEXP_LIKE, and XML functions.
    • Some security encryption and decryption functions, anonymization functions, and projection aliases display functions may have security problems. Therefore, only function names are displayed here, including gs_encrypt_aes128, gs_decrypt_aes128, gs_encrypt, gs_decrypt, aes_encrypt, aes_decrypt, pg_create_physical_replication_slot_extern, dblink_connect,creditcardmasking, "basicemailmasking", fullemailmasking, alldigitsmasking, shufflemasking, randommasking, regexpmasking, and gs_digest.
    • The parameter transfer mode using => is not supported for the projection alias to display the complete function. The projection alias cannot contain double quotation marks (""), for example, select "power" (2,3).
    • To enable the projection alias to display the complete function, this function is not affected by parameters such as removing 0 at the end.

allow_rownum_alias

After this parameter is enabled, ROWNUM can be used as a column alias in SQL statements using the AS syntax. ROWNUM is used as a common identifier and cannot be used as a pseudocolumn.

WARNING:

You are not advised to change the status of this parameter during service execution. When the parameter is enabled, database objects (such as table names, column names, and database names) created using ROWNUM as the name in the database can be used only when the parameter is enabled. Otherwise, ambiguity occurs and the behavior is unpredictable. When the parameter is disabled, the behavior of using ROWNUM as a pseudocolumn in the database becomes invalid after the parameter is enabled and the behavior is unpredictable.

current_sysdate

If this parameter is enabled, the current OS time is returned when the sysdate command is executed.

gaussdb=# set behavior_compat_options='current_sysdate';

SET

gaussdb=# select sysdate;

current_sysdate

---------------------

2023-06-20 20:15:27

(1 row)

a_format_version

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

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

Value range: a string

Default value: ""

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

Compatibility Configuration Item

Behavior

10c

The ORA platform is compatible with the 10C version.

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 parameter is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: a string

Default value: ""

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

Compatibility Configuration Item

Behavior

s1

  • Compatible minor version of the ORA platform, which affects functions TRUNC(date, fmt), ROUND(date, fmt), NVL2, LPAD, RPAD, ADD_MONTHS, MONTHS_BETWEEN, REGEXP_REPLACE, REGEXP_COUNT, TREAT, EMPTY_CLOB, INSTRB, trunc(number), greatest, least, mod, round(number), cast, to_date, to_timestamp, chr, rtrim, translate, to_char, to_number, and to_timestamp_tz.
  • Data type conversion: A decimal character string is rounded off when it is converted to an integer (int1/int2/int4/int8/int16).
  • Data type conversion: Implicit conversion from timestamp with time zone to timestamp without time zone is supported.

s2

  • Compatible minor version of platform A, which affects functions, such as dump, to_single_byte, to_multi_byte, nls_upper, nls_lower, initcap, ascii2, asciistr, unistr, vsize, cosh, remainder, sinh, tanh, nanvl, current_date, current_timestamp, dbtimezone, numtodsinterval, numtoyminterval, new_time, sessiontimezone, sys_extract_utc, tz_offset, to_binary_double, to_binary_float, to_dsinterval, to_yminterval, lnnvl, and ora_hash.
  • Supports all behaviors when the compatibility configuration item is set to s1.

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 method 3 provided in Table 1.

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.

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 parameter is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

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

Default value: off

nls_timestamp_format

Parameter description: Specifies the default timestamp format.

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

Value range: a string

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

nls_timestamp_tz_format

Parameter description: Specifies the default timestamp with time zone format.

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

Value range: a string. The supported formats are the same as those of nls_timestamp_format.

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

This parameter is valid only when a_format_version is set to 10c and a_format_dev_version is set to s1.

max_function_args

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

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

Value range: an integer.

Default value: 8192

convert_string_to_digit

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

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

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

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