Updated on 2025-05-29 GMT+08:00

Compatibility with Earlier Versions

This section describes the parameters that control the backward compatibility and external compatibility of GaussDB. A backward compatible database supports applications of earlier versions. This section describes parameters used for controlling backward compatibility of a database.

array_nulls

Parameter description: Specifies whether the array input parser recognizes unquoted NULL as a null array element.

Parameter type: Boolean.

Unit: none

Value range:

  • on: Null values can be entered in arrays.
  • off: Old behaviors are backward compatible. Arrays containing the value NULL can still be created when this parameter is set to off.

Default value: on

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

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

backslash_quote

Parameter description: Determines whether a single quotation mark can be represented by \' in a string text.

When the string text meets the SQL standards, \ has no other meanings. This parameter only affects the handling of non-standard-conforming string texts, including escape string syntax (E'...').

Parameter type: enumerated type.

Unit: none

Value range:

  • on: The use of \' is always allowed.
  • off: The use of \' is not allowed.
  • safe_encoding: The use is allowed only when client-side encoding does not contain \ at the end of a multibyte character for an ASCII value.

Default value: safe_encoding

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

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

escape_string_warning

Parameter description: Specifies whether to warn against backslash (\) escapes used in ordinary character strings.

  • If you need to use a backslash (\) as an escape, you can use escape string syntax (E'...'). This is because the default behavior of ordinary character strings treats the backslash as an ordinary character in each SQL standard.
  • This variable can be enabled to help locate codes that need to be changed.
  • If E'...' is used as an escape, logs may be incomplete in some scenarios.

Parameter type: Boolean.

Unit: none

Value range:

  • on: Warn against backslash escapes used in ordinary character strings.
  • off: Do not warn against backslash escapes used in ordinary character strings.

Default value: on

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

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

lo_compat_privileges

Parameter description: Specifies whether to enable backward compatibility for the privilege check of large objects.

Parameter type: Boolean.

Unit: none

Value range:

  • on: The privilege check is disabled when large objects are read or modified.
  • off: The privilege check is enabled for large objects.

Default value: off

Setting method: This is a SUSET parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

quote_all_identifiers

Parameter description: Specifies whether to forcibly quote all identifiers even if they are not keywords when the database generates SQL. This will affect the output of EXPLAIN and the results of functions, such as pg_get_viewdef. For details, see the --quote-all-identifiers option in "Data Import and Export Tools > gs_dump for Exporting Database Information" in Tool Reference.

Parameter type: Boolean.

Unit: none

Value range:

  • on: The forcible quoting is enabled.
  • off: The forcible quoting is disabled.

Default value: off

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

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

sql_inheritance

Parameter description: Specifies the access policy of an inherited table. This parameter is set to be compatible with earlier versions.

Parameter type: Boolean.

Unit: none

Value range:

  • on: Subtables can be accessed.
  • off: Subtables cannot be accessed. That is, the ONLY keyword is used by default.

Default value: on

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

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

standard_conforming_strings

Parameter description: Specifies whether ordinary string texts ('...') regard backslashes (\) as ordinary texts as specified in the SQL standard. Applications can check this parameter to determine how string texts will be processed. It is recommended that characters be escaped by using the escape string syntax (E'...').

Parameter type: Boolean.

Unit: none

Value range:

  • on: Backslashes are regarded as ordinary texts as specified in the SQL standard.
  • off: Backslashes are regarded as escape characters in the string literal value.

Default value: on

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

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

synchronize_seqscans

Parameter description: Specifies whether parallel sequence scans are synchronized with each other.

Parameter type: Boolean.

Unit: none

Value range:

  • on: The scan may start from the middle of the table and then overwrite all rows in surround mode. The purpose is to keep synchronization with the scan that is being executed. This synchronization mechanism can improve the performance of parallel sequence scanning, but queries without using ORDER BY may return out-of-order results.
  • off: The synchronization behavior of order scans is disabled. Each scan starts from the start position of the table. This ensures that queries without using ORDER BY return results that are consistent with the physical storage sequence, but parallel scanning efficiency may be reduced.

Default value: on

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

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

enable_beta_features

Parameter description: Specifies whether to enable some features that are not officially released and are used only for POC verification, such as GDS table join.

Parameter type: Boolean.

Unit: none

Value range:

  • on: The features are enabled for forward compatibility.
  • off: The features are disabled.

Default value: off

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

Setting suggestion: Exercise caution when enabling these extended features because they may cause errors in some scenarios.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

enable_recordtype_check_strict

Parameter description: Specifies whether to perform strict check on the record type in PL/SQL. For details, see the following description.

Parameter type: Boolean.

Unit: none

Value range:

  • on: The record type created during compilation of stored procedures, functions, and packages is checked for unsupported functions, and the record type created by provided stored procedures and functions is checked for the NOT NULL function.
  • off: The backward compatibility is performed and the record type is not checked.

Default value: on

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

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: If this parameter is set to off, some record variables that specify the NOT NULL constraint and define the default value of a column do not take effect during value assignment.

  • After an upgrade from an earlier version, this parameter is set to off by default.
  • After this parameter is enabled, the following three changes occur:
    • For the record type created in a stored procedure or function, the NOT NULL constraint of the columns takes effect.
    • If NOT NULL or DEFAULT is specified for a column of the record type created in a package, a compilation error is reported. Variables created by accessing the package.rec type do not support NOT NULL and DEFAULT.
    • If NOT NULL or DEFAULT is specified for a column of another type with a nested record type, a compilation error is reported. For a variable nested with the record type, the record element of the variable does not support NOT NULL and DEFAULT.

plsql_block_concat_typename

Parameter description: Specifies the combination mode of user-defined type names in PL/SQL subblocks.

Parameter type: Boolean.

Unit: none

Value range:

  • on: A user-defined type in the PL/SQL subblock is used. The name of the user-defined type in the SQL statement is in the format of OID.[m.n···].typename, where OID is the OID of the stored procedure, typename is the name of the user-defined type, and m and n are sequence numbers of subblocks. When a plurality of layers of subblocks are nested, a plurality of layers of sequence numbers are required. If there is only a single layer of subblocks, only m is required.
  • off: The backward compatibility in original mode is used. The name format is OID.typename.

Default value: on

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

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: If the value is off and the user-defined types in a subblock have the same name, the SQL statement cannot distinguish the user-defined types of different subblocks.

After an upgrade from an earlier version, this parameter is set to off by default.

default_with_oids

Parameter description: Specifies whether CREATE TABLE and CREATE TABLE AS include an OID field in newly-created tables if neither WITH OIDS nor WITHOUT OIDS is specified. It also determines whether OIDs will be included in tables created by SELECT INTO.

Parameter type: Boolean.

Unit: none

Value range:

  • on indicates that CREATE TABLE and CREATE TABLE AS can include an OID column in newly-created tables.
  • off indicates that CREATE TABLE and CREATE TABLE AS cannot include any OID column in newly-created tables.

Default value: off

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

Setting suggestion: It is not recommended that OIDs be used in user tables. Therefore, this parameter is set to off by default. When OIDs are required for a particular table, WITH OIDS needs to be specified during the table creation.

Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

system_view_version

Parameter description: Determines the version of the system view. For details, see Table 1 System view version parameters. All versions are backward compatible. For example, when system_view_version is set to 3, all features of version 2 and version 1 are also supported.

Parameter type: integer.

Unit: none

Value range: 0 to 9999

Default value: 0

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

Setting suggestion: In the upgrade scenario, do not change the value. In the installation scenario, set this parameter to the latest version listed in Table 1 System view version parameters.

Risks and impacts of improper settings: The behavior of some columns in the system view is changed. For details, see Table 1 System view version parameters.

Table 1 System view version parameters

Value

Description

0

Default behavior.

1

When no prepared transaction exists in GaussDB, the value of the PREPARECOUNT column in the V$GLOBAL_TRANSACTION view changes from NULL to 0.