Movatterモバイル変換


[0]ホーム

URL:


September 25, 2025: PostgreSQL 18 Released!
DocumentationPostgreSQL devel (2025-10-08 08:06:47 - git commit8e11859102f)
Supported Versions:Current (18) /17 /16 /15 /14 /13
Development Versions:devel
Unsupported versions:12 /11 /10 /9.6 /9.5 /9.4
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for thecurrent version, or one of the other supported versions listed above instead.
47.6. Logical Decoding Output Plugins
Prev UpChapter 47. Logical DecodingHome Next

47.6. Logical Decoding Output Plugins#

PostgreSQL provides two logical decoding output plugins,pgoutput andtest_decoding. You can also develop custom output plugins (seeSection 47.7 for details).

47.6.1. pgoutput — Standard Logical Decoding Output Plugin#

pgoutput is the standard logical decoding output plugin provided byPostgreSQL. It's used for the built-inlogical replication.

47.6.1.1. Options#

proto_version (integer)#

Specifies the protocol version. Currently versions1,2,3, and4 are supported. A valid version is required.

Version2 is supported on server version 14 and above, and is required whenstreaming is set toon to stream large in-progress transactions.

Version3 is supported on server version 15 and above, and is required whentwo_phase is enabled to stream two-phase commits.

Version4 is supported on server version 16 and above, and is required whenstreaming is set toparallel to 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 isoff.

messages (boolean)#

Enables sending the messages that are written bypg_logical_emit_message. The default isoff.

streaming (enum)#

Enables streaming of in-progress transactions. Valid values areoff (the default),on andparallel.

When set tooff,pgoutput fully decodes a transaction before sending it as a whole. This mode works with any protocol version.

When set toon,pgoutput streams large in-progress transactions. This requires protocol version 2 or higher.

When set toparallel,pgoutput streams 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 isoff.

origin (enum)#

Specifies whether to send changes by their origin. Possible values arenone to only send the changes that have no origin associated, orany to 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 andpg_logical_slot_get_changes) cannot be used with it. Usepg_logical_slot_peek_binary_changes orpg_logical_slot_get_binary_changes instead.


Prev Up Next
47.5. System Catalogs Related to Logical Decoding Home 47.7. Writing Logical Decoding Output Plugins

[8]ページ先頭

©2009-2025 Movatter.jp