Configuration options
Some aspects of PGLogical can be configured using configuration options that
can be either set in postgresql.conf or via ALTER SYSTEM SET.
pglogical.conflict_resolutionSets the resolution method for any detected conflicts between local data and incoming changes.Possible values:
error- the replication will stop on error if conflict is detected and manual action is needed for resolvingapply_remote- always apply the change that's conflicting with local datakeep_local- keep the local version of the data and ignore the conflicting change that is coming from the remote nodelast_update_wins- the version of data with newest commit timestamp will be kept (this can be either local or remote version)first_update_wins- the version of the data with oldest timestamp will be kept (this can be either local or remote version)
The available settings and defaults depend on version of PostgreSQL and other settings.
The default value in PostgreSQL is
apply_remote.The
keep_local,last_update_winsandfirst_update_winssettings requiretrack_commit_timestampPostgreSQL setting to be enabled. Astrack_commit_timestampis not available in PostgreSQL 9.4pglogical.conflict_resolutioncan only beapply_remoteorerror.In Postgres-XL, the only supported value and the default is
error.pglogical.conflict_log_levelSets the log level for reporting detected conflicts when thepglogical.conflict_resolutionis set to anything else thanerror.Main use for this setting is to suppress logging of conflicts.
Possible values are same as for
log_min_messagesPostgreSQL setting.The default is
LOG.pglogical.batch_insertsTells PGLogical to use batch insert mechanism if possible. Batch mechanism uses PostgreSQL internal batch insert mode which is also used byCOPYcommand.The batch inserts will improve replication performance of transactions that did many inserts into one table. PGLogical will switch to batch mode when transaction did more than 5 INSERTs.
It's only possible to switch to batch mode when there are no
INSTEAD OF INSERTandBEFORE INSERTtriggers on the table and when there are no defaults with volatile expressions for columns of the table. Also the batch mode will only work whenpglogical.conflict_resolutionis set toerror.The default is
true.pglogical.use_spiTells PGLogical to use SPI interface to form actual SQL (INSERT,UPDATE,DELETE) statements to apply incoming changes instead of using internal low level interface.This is mainly useful for Postgres-XL and debugging purposes.
The default in PostgreSQL is
false.This can be set to
trueonly whenpglogical.conflict_resolutionis set toerror. In this state, conflicts are not detected.In Postgres-XL the default and only allowed setting is
true.pglogical.temp_directoryDefines system path where to put temporary files needed for schema synchronization. This path need to exist and be writable by user running Postgres.Default is empty, which tells PGLogical to use default temporary directory based on environment and operating system settings.
Could this page be better? Report a problem or suggest an addition!