aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2014-10-01 13:13:59 +0200
committerAndres Freund <andres@anarazel.de>2014-10-01 13:22:17 +0200
commit0ef3c29a4b43e72d93cff65a17a9ccccff87618d (patch)
treedd09f894757e2b09e91798669d9c16c96cfbe64d /doc/src
parentef8863844bb0b0dab7b92c5f278302a42b4bf05a (diff)
downloadpostgresql-0ef3c29a4b43e72d93cff65a17a9ccccff87618d.tar.gz
postgresql-0ef3c29a4b43e72d93cff65a17a9ccccff87618d.zip
Improve documentation about binary/textual output mode for output plugins.
Also improve related error message as it contributed to the confusion. 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.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/logicaldecoding.sgml21
1 files changed, 20 insertions, 1 deletions
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);
</para>
</sect2>
+ <sect2 id="logicaldecoding-output-mode">
+ <title>Output Modes</title>
+ <para>
+ 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 <literal>OutputPluginOptions.output_mode</>
+ to <literal>OUTPUT_PLUGIN_TEXTUAL_OUTPUT</> instead
+ of <literal>OUTPUT_PLUGIN_BINARY_OUTPUT</> in
+ the <link linkend="logicaldecoding-output-plugin-startup">startup
+ callback</>. In that case all the data has to be in the server's encoding
+ so a <type>text</> can contain it. This is checked in assertion enabled
+ builds.
+ </para>
+ </sect2>
+
<sect2 id="logicaldecoding-output-plugin-callbacks">
<title>Output Plugin Callbacks</title>
<para>
@@ -405,7 +423,8 @@ typedef struct OutputPluginOptions
</programlisting>
<literal>output_type</literal> has to either be set to
<literal>OUTPUT_PLUGIN_TEXTUAL_OUTPUT</literal>
- or <literal>OUTPUT_PLUGIN_BINARY_OUTPUT</literal>.
+ or <literal>OUTPUT_PLUGIN_BINARY_OUTPUT</literal>. See also
+ <xref linkend="logicaldecoding-output-mode"/>.
</para>
<para>
The startup callback should validate the options present in