47.6. Logical Decoding Output Plugins #
PostgreSQL provides two logical decoding output plugins, pgoutput and test_decoding. You can also develop custom output plugins (see Section 47.7 for details).
47.6.1. pgoutput — Standard Logical Decoding Output Plugin #
pgoutput is the standard logical decoding output
plugin provided by PostgreSQL.
It's used for the built-in
logical replication.
47.6.1.1. Options #
proto_version(integer) #Specifies the protocol version. Currently versions
1,2,3, and4are supported. A valid version is required.Version
2is supported on server version 14 and above, and is required whenstreamingis set toonto stream large in-progress transactions.Version
3is supported on server version 15 and above, and is required whentwo_phaseis enabled to stream two-phase commits.Version
4is supported on server version 16 and above, and is required whenstreamingis set toparallelto stream large in-progress transactions to be applied in parallel.publication_names(string) #A comma-separated list of publication names to subscribe to. The individual publication names are treated as standard objects names and can be quoted the same as needed. At least one publication name is required.
binary(boolean) #Enables binary transfer mode. Binary mode is faster than the text mode but slightly less robust. The default is
off.messages(boolean) #Enables sending the messages that are written by
pg_logical_emit_message. The default isoff.streaming(enum) #Enables streaming of in-progress transactions. Valid values are
off(the default),onandparallel.When set to
off,pgoutputfully decodes a transaction before sending it as a whole. This mode works with any protocol version.When set to
on,pgoutputstreams large in-progress transactions. This requires protocol version 2 or higher.When set to
parallel,pgoutputstreams large in-progress transactions and also sends extra information in some messages to support parallel processing. This requires protocol version 4 or higher.two_phase(boolean) #Enables sending two-phase transactions. Minimum protocol version 3 is required to turn it on. The default is
off.origin(enum) #Specifies whether to send changes by their origin. Possible values are
noneto only send the changes that have no origin associated, oranyto send the changes regardless of their origin. This can be used to avoid loops (infinite replication of the same data) among replication nodes. The default isany.
47.6.1.2. Notes #
pgoutput produces binary output,
so functions expecting textual data (
pg_logical_slot_peek_changes and
pg_logical_slot_get_changes)
cannot be used with it. Use
pg_logical_slot_peek_binary_changes or
pg_logical_slot_get_binary_changes
instead.
Report a documentation issue
Read the upstream documentation. For corrections, first check the current manual.