Updated on 2026-10-21 GMT+08:00

Logical Replication

max_changes_in_memory

Parameter description: Specifies the maximum number of DML statements cached in memory for a single transaction during logical decoding.

Parameter type: integer.

Unit: none

Value range: 1 to 2147483647

Default value: 4096

Setting method: This is a SIGHUP 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 too large, a large amount of dynamic memory is occupied when large transactions are decoded. If the value is too small, the decoding efficiency decreases.

max_cached_tuplebufs

Parameter description: Specifies the upper limit of the total tuple information cached in the memory during logical decoding.

Parameter type: integer.

Unit: none

Value range: 1 to 2147483647

Default value: 8192

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

Setting suggestion: Retain the default value. You are advised to set this parameter to a value greater than or equal to twice of max_changes_in_memory.

Risks and impacts of improper settings: If the value is too large, a large amount of dynamic memory is occupied when large transactions are decoded. If the value is too small, the decoding efficiency decreases.

logical_decode_options_default

Parameter description: Specifies the global default parameters when a logical decoding task is started.

Parameter type: string.

Unit: none

Value range: Currently, the following logical decoding options can be specified: parallel-decode-num, parallel-queue-size, max-txn-in-memory, max-reorderbuffer-in-memory, exclude-users, skip-generated-columns, decode-sequence, max-control-memory-size, max-toast-memory-size, max-queue-cache-num, desc-memory-limit, data-limit, and enable-cn-decode. For details about the options, see "Feature Usage Guidelines > Logical Replication > Logical Decoding (Non-Multi-Primary) > Logical Decoding Options" in Developer Guide.

  • Multiple key=value pairs in a string are separated by commas (,), for example, "parallel-decode-num=4,parallel-queue-size=128,exclude-users=userA,skip-generated-columns=on".
  • The exclude-users option specified by logical_decode_options_default is different from the logical decoding startup option exclude-users. You are not allowed to specify multiple blacklisted users.
  • decode-sequence configured in logical_decode_options_default can only be set to false.

Default value: "". An empty string indicates that the default value of the program is used.

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

The setting of this SIGHUP parameter does not affect the logical decoding process that has been started. The setting of this parameter will be used as the default configuration for subsequent logical decoding startup. If the same configuration item exists in the decoding task startup command, the default value of the corresponding option of logical_decode_options_default does not take effect. Instead, the value specified in the startup command is used.

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.

logical_decode_options_extend

Parameter description: Specifies the global default parameters when a logical decoding task is started. This parameter can be set at the PDB level.

Parameter type: string.

Unit: none

Value range: a string that contains XIDs, separated by slashes (/), for example, "skip-xid-list=9737819/9737823". Valid XIDs range from 3 to 18446744073709551615.

Default value: "", indicating that the preset default value is used.

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1. Currently, the following logical decoding options can be specified: skip-xid-list. For details about the options, see "Feature Usage Guidelines > Logical Replication > Logical Decoding (Non-Multi-Primary) > Logical Decoding Options" in Developer Guide.

The setting of this parameter does not affect the logical decoding process that has been started. The setting of this parameter will be used as the default configuration for subsequent logical decoding startup. If the same configuration item exists in the decoding task startup command, the default value of the corresponding option of logical_decode_options_extend does not take effect. Instead, the value specified in the startup command is used.

Setting suggestion: Retain the default value.

Risks and impacts of improper settings: Change the parameter value after you fully understand the parameter meaning and test the parameter. If the XIDs are incorrectly set, transactions may be skipped unexpectedly, causing data loss during decoding.

logical_sender_timeout

Parameter description: Specifies the maximum waiting time for the sender to wait for the receiver to receive logical logs.

Parameter type: integer.

Unit: milliseconds

Value range: 0 to 2147483647

Default value: 30000 (30s)

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_logicalrepl_xlog_prune

Parameter description: Specifies whether to enable the function of forcibly invalidating a logical replication slot. When the GUC parameters enable_logicalrepl_xlog_prune is set to on, max_size_for_xlog_retention is greater than 0, and the number of retained log segments (16 MB for each log segment) exceeds the value of max_size_for_xlog_retention due to the current logical replication slot, or max_size_for_xlog_retention is less than 0 and the disk usage reaches (–max_size_for_xlog_retention)/100, the logical replication slot will be forcibly invalidated, restart_lsn is set to 7FFFFFFF/FFFFFFFF, and the replication slot does not block the recycling of Xlogs.

Parameter type: Boolean.

Unit: none

Value range:

  • on: The function of forcibly invalidating a logical replication slot is enabled.
  • off: The function of forcibly invalidating a logical replication slot is disabled.

Default value: off

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

Setting suggestion: Determine whether to enable this function based on service requirements.

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

enable_logical_replication_ddl

Parameter description: Specifies whether the logical decoding supports DDL statements, reverse parsing, and log generation.

Parameter type: Boolean.

Unit: none

Value range:

  • on: Logical replication supports DDL statements, reversely parses DDL execution results, and generates DDL WALs.
  • off: DDL statements are not supported, reverse parsing is not performed, and WALs are not generated.

Default value: on

Setting method: This is a SIGHUP 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.

max_keep_log_seg

Parameter description: Flow control parameter. In logical replication, physical logs are parsed and converted into logical logs locally on the DN. When the number of physical log files that are not parsed is greater than the value of this parameter, flow control is triggered.

Parameter type: integer.

Unit: none

Value range: 0 to 2147483647. 0 indicates that the flow control function is disabled.

Default value: 0

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

Setting suggestion: Determine whether to perform flow control based on service requirements.

Risks and impacts of improper settings: If the value is too large, flow control will not be triggered.

logical_replication_dictionary_retention_time

Parameter description: Specifies the retention period of data in the system catalogs related to GS_TXN_LSN_TIME and the data dictionary.

Parameter type: integer

Unit: days (d)

Value range: 1 to 3650

Default value: 365

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

Setting suggestion: Set this parameter based on service requirements.

Risks and impacts of improper settings: If the value is too small, the available interval for decoding the positioning point is too small. If the value is too large, the decoding performance is affected.

logical_replica_identity_force

Parameter description: Specifies the record level of old tuples for global logical replication.

Parameter type: enumerated type

Unit: none

Value range:

  • 'full': All columns are recorded as replica identifiers.
  • 'unique': The replica identifier is the primary key and unique key.
  • 'default': The replica identifier is selected by default (primary key or none).
  • 'nothing': There is no replica identifier for recording this relationship.
  • 'none': The global control parameter does not take effect.

Default value: 'none'

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

To reset logical_replica_identity_force that has been set to a non-default value to 'none', you need to restore the GUC parameter to the default value.

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.