From ce84b0682cd169738797f74ec8acc1701b9da40c Mon Sep 17 00:00:00 2001
From: Andres Freund
Date: Wed, 1 Oct 2014 13:13:59 +0200
Subject: Improve documentation about binary/textual output mode for output
plugins.
Discussion: CAB7nPqQrqFzjqCjxu4GZzTrD9kpj6HMn9G5aOOMwt1WZ8NfqeA@mail.gmail.com,
CAB7nPqQXc_+g95zWnqaa=mVQ4d3BVRs6T41frcEYi2ocUrR3+A@mail.gmail.com
Per discussion between Michael Paquier, Robert Haas and Andres Freund
Backpatch to 9.4 where logical decoding was introduced.
---
doc/src/sgml/logicaldecoding.sgml | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
(limited to 'doc/src/sgml')
diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml
index e6880d0ac58..1f56b39df94 100644
--- a/doc/src/sgml/logicaldecoding.sgml
+++ b/doc/src/sgml/logicaldecoding.sgml
@@ -355,6 +355,24 @@ CREATE TABLE another_catalog_table(data text) WITH (user_catalog_table = true);
+
+ Output Modes
+
+ Output plugin callbacks can pass data to the consumer in nearly arbitrary
+ formats. For some use cases, like viewing the changes via SQL, returning
+ data in a datatype that can contain arbitrary data (i.e. bytea) is
+ cumbersome. If the output plugin only outputs textual data in the
+ server's encoding it can declare that by
+ setting OutputPluginOptions.output_mode>
+ to OUTPUT_PLUGIN_TEXTUAL_OUTPUT> instead
+ of OUTPUT_PLUGIN_BINARY_OUTPUT> in
+ the startup
+ callback>. In that case all the data has to be in the server's encoding
+ so a text> can contain it. This is checked in assertion enabled
+ builds.
+
+
+
Output Plugin Callbacks
@@ -405,7 +423,8 @@ typedef struct OutputPluginOptions
output_type has to either be set to
OUTPUT_PLUGIN_TEXTUAL_OUTPUT
- or OUTPUT_PLUGIN_BINARY_OUTPUT.
+ or OUTPUT_PLUGIN_BINARY_OUTPUT. See also
+ .
The startup callback should validate the options present in
--
cgit v1.2.3