Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3ee4fcfc
Commit
3ee4fcfc
authored
Mar 18, 2014
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logical decoding documentation corrections.
Thom Brown
parent
a3b30d4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
doc/src/sgml/logicaldecoding.sgml
doc/src/sgml/logicaldecoding.sgml
+14
-14
No files found.
doc/src/sgml/logicaldecoding.sgml
View file @
3ee4fcfc
...
@@ -42,12 +42,12 @@
...
@@ -42,12 +42,12 @@
<sect1 id="logicaldecoding-example">
<sect1 id="logicaldecoding-example">
<title>Logical Decoding Example</title>
<title>Logical Decoding Example</title>
<para>
<para>
The following example demonst
ar
tes the SQL interface.
The following example demonst
ra
tes the SQL interface.
</para>
</para>
<para>
<para>
Before you can use logical decoding, you must set
Before you can use logical decoding, you must set
<xref linkend="guc-wal-level"> to logical and
<xref linkend="guc-wal-level"> to logical and
<xref linkend="guc-max-replication-slots">
ot
at least 1.
<xref linkend="guc-max-replication-slots">
to
at least 1.
Then, you should connect to the target database (in the example
Then, you should connect to the target database (in the example
below, <literal>postgres</literal>) as a superuser.
below, <literal>postgres</literal>) as a superuser.
</para>
</para>
...
@@ -98,8 +98,8 @@ postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NU
...
@@ -98,8 +98,8 @@ postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NU
location | xid | data
location | xid | data
-----------+-----+-----------------------------------------------
-----------+-----+-----------------------------------------------
0/16E0478 | 689 | BEGIN 689
0/16E0478 | 689 | BEGIN 689
0/16E0478 | 689 | table public.data: INSERT: id[int
4
]:1 data[text]:'1'
0/16E0478 | 689 | table public.data: INSERT: id[int
eger
]:1 data[text]:'1'
0/16E0580 | 689 | table public.data: INSERT: id[int
4
]:2 data[text]:'2'
0/16E0580 | 689 | table public.data: INSERT: id[int
eger
]:2 data[text]:'2'
0/16E0650 | 689 | COMMIT 689
0/16E0650 | 689 | COMMIT 689
(4 rows)
(4 rows)
...
@@ -110,7 +110,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
...
@@ -110,7 +110,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
location | xid | data
location | xid | data
-----------+-----+-----------------------------------------------
-----------+-----+-----------------------------------------------
0/16E09C0 | 690 | BEGIN 690
0/16E09C0 | 690 | BEGIN 690
0/16E09C0 | 690 | table public.data: INSERT: id[int
4
]:3 data[text]:'3'
0/16E09C0 | 690 | table public.data: INSERT: id[int
eger
]:3 data[text]:'3'
0/16E0B90 | 690 | COMMIT 690
0/16E0B90 | 690 | COMMIT 690
(3 rows)
(3 rows)
...
@@ -119,7 +119,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
...
@@ -119,7 +119,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
location | xid | data
location | xid | data
-----------+-----+-----------------------------------------------
-----------+-----+-----------------------------------------------
0/16E09C0 | 690 | BEGIN 690
0/16E09C0 | 690 | BEGIN 690
0/16E09C0 | 690 | table public.data: INSERT: id[int
4
]:3 data[text]:'3'
0/16E09C0 | 690 | table public.data: INSERT: id[int
eger
]:3 data[text]:'3'
0/16E0B90 | 690 | COMMIT 690
0/16E0B90 | 690 | COMMIT 690
(3 rows)
(3 rows)
...
@@ -128,7 +128,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
...
@@ -128,7 +128,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
location | xid | data
location | xid | data
-----------+-----+-----------------------------------------------
-----------+-----+-----------------------------------------------
0/16E09C0 | 690 | BEGIN 690
0/16E09C0 | 690 | BEGIN 690
0/16E09C0 | 690 | table public.data: INSERT: id[int
4
]:3 data[text]:'3'
0/16E09C0 | 690 | table public.data: INSERT: id[int
eger
]:3 data[text]:'3'
0/16E0B90 | 690 | COMMIT 690 (at 2014-02-27 16:41:51.863092+01)
0/16E0B90 | 690 | COMMIT 690 (at 2014-02-27 16:41:51.863092+01)
(3 rows)
(3 rows)
...
@@ -155,7 +155,7 @@ CTRL-Z
...
@@ -155,7 +155,7 @@ CTRL-Z
# psql -c "INSERT INTO data(data) VALUES('4');"
# psql -c "INSERT INTO data(data) VALUES('4');"
# fg
# fg
BEGIN 693
BEGIN 693
table public.data: INSERT: id[int
4
]:4 data[text]:'4'
table public.data: INSERT: id[int
eger
]:4 data[text]:'4'
COMMIT 693
COMMIT 693
CTRL-C
CTRL-C
# pg_recvlogical -d testdb --slot test --drop
# pg_recvlogical -d testdb --slot test --drop
...
@@ -251,7 +251,7 @@ CTRL-C
...
@@ -251,7 +251,7 @@ CTRL-C
SNAPSHOT</literal></link> to read the state of the database at the moment
SNAPSHOT</literal></link> to read the state of the database at the moment
the slot was created. This transaction can then be used to dump the
the slot was created. This transaction can then be used to dump the
database's state at that point in time which afterwards can be updated
database's state at that point in time which afterwards can be updated
using the slot's contents without lo
o
sing any changes.
using the slot's contents without losing any changes.
</para>
</para>
</sect2>
</sect2>
</sect1>
</sect1>
...
@@ -344,7 +344,7 @@ typedef void (*LogicalOutputPluginInit)(struct OutputPluginCallbacks *cb);
...
@@ -344,7 +344,7 @@ typedef void (*LogicalOutputPluginInit)(struct OutputPluginCallbacks *cb);
backend's normal infrastructure, including calling output functions. Read
backend's normal infrastructure, including calling output functions. Read
only access to relations is permitted as long as only relations are
only access to relations is permitted as long as only relations are
accessed that either have been created by <command>initdb</command> in
accessed that either have been created by <command>initdb</command> in
the <literal>pg_catalog</literal> schema, or have
are
marked as user
the <literal>pg_catalog</literal> schema, or have
been
marked as user
provided catalog tables using
provided catalog tables using
<programlisting>
<programlisting>
ALTER TABLE user_catalog_table SET (user_catalog_table = true);
ALTER TABLE user_catalog_table SET (user_catalog_table = true);
...
@@ -368,9 +368,9 @@ CREATE TABLE another_catalog_table(data text) WITH (user_catalog_table = true);
...
@@ -368,9 +368,9 @@ CREATE TABLE another_catalog_table(data text) WITH (user_catalog_table = true);
the <literal>begin</literal> and <literal>commit</literal>
the <literal>begin</literal> and <literal>commit</literal>
callbacks. Transactions that were rolled back explicitly or implicitly
callbacks. Transactions that were rolled back explicitly or implicitly
never get
never get
decoded. Successful
l
<link linkend="SQL-SAVEPOINT">SAVEPOINTs</link> are
decoded. Successful <link linkend="SQL-SAVEPOINT">SAVEPOINTs</link> are
folded into the transaction containing them in the order they were
folded into the transaction containing them in the order they were
exec
tud
ed within that transaction.
exec
ut
ed within that transaction.
</para>
</para>
<note>
<note>
<para>
<para>
...
@@ -385,7 +385,7 @@ CREATE TABLE another_catalog_table(data text) WITH (user_catalog_table = true);
...
@@ -385,7 +385,7 @@ CREATE TABLE another_catalog_table(data text) WITH (user_catalog_table = true);
<title>Startup Callback</title>
<title>Startup Callback</title>
<para>
<para>
The optional <function>startup_cb</function> callback is called whenever
The optional <function>startup_cb</function> callback is called whenever
a
n
replication slot is created or asked to stream changes, independent
a replication slot is created or asked to stream changes, independent
of the number of changes that are ready to be put out.
of the number of changes that are ready to be put out.
<programlisting>
<programlisting>
typedef void (*LogicalDecodeStartupCB) (
typedef void (*LogicalDecodeStartupCB) (
...
@@ -394,7 +394,7 @@ typedef void (*LogicalDecodeStartupCB) (
...
@@ -394,7 +394,7 @@ typedef void (*LogicalDecodeStartupCB) (
bool is_init
bool is_init
);
);
</programlisting>
</programlisting>
The <literal>is_init</literal> paramter will be true when the
The <literal>is_init</literal> param
e
ter will be true when the
replication slot is being created and false
replication slot is being created and false
otherwise. <parameter>options</parameter> points to a struct of options
otherwise. <parameter>options</parameter> points to a struct of options
that output plugins can set:
that output plugins can set:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment