42
42
<sect1 id="logicaldecoding-example">
43
43
<title>Logical Decoding Example</title>
44
44
<para>
45
- The following example demonstartes the SQL interface.
45
+ The following example demonstrates the SQL interface.
46
46
</para>
47
47
<para>
48
48
Before you can use logical decoding, you must set
49
49
<xref linkend="guc-wal-level"> to logical and
50
- <xref linkend="guc-max-replication-slots"> ot at least 1.
50
+ <xref linkend="guc-max-replication-slots"> to at least 1.
51
51
Then, you should connect to the target database (in the example
52
52
below, <literal>postgres</literal>) as a superuser.
53
53
</para>
@@ -98,8 +98,8 @@ postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NU
98
98
location | xid | data
99
99
-----------+-----+-----------------------------------------------
100
100
0/16E0478 | 689 | BEGIN 689
101
- 0/16E0478 | 689 | table public.data: INSERT: id[int4 ]:1 data[text]:'1'
102
- 0/16E0580 | 689 | table public.data: INSERT: id[int4 ]:2 data[text]:'2'
101
+ 0/16E0478 | 689 | table public.data: INSERT: id[integer ]:1 data[text]:'1'
102
+ 0/16E0580 | 689 | table public.data: INSERT: id[integer ]:2 data[text]:'2'
103
103
0/16E0650 | 689 | COMMIT 689
104
104
(4 rows)
105
105
@@ -110,7 +110,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
110
110
location | xid | data
111
111
-----------+-----+-----------------------------------------------
112
112
0/16E09C0 | 690 | BEGIN 690
113
- 0/16E09C0 | 690 | table public.data: INSERT: id[int4 ]:3 data[text]:'3'
113
+ 0/16E09C0 | 690 | table public.data: INSERT: id[integer ]:3 data[text]:'3'
114
114
0/16E0B90 | 690 | COMMIT 690
115
115
(3 rows)
116
116
@@ -119,7 +119,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
119
119
location | xid | data
120
120
-----------+-----+-----------------------------------------------
121
121
0/16E09C0 | 690 | BEGIN 690
122
- 0/16E09C0 | 690 | table public.data: INSERT: id[int4 ]:3 data[text]:'3'
122
+ 0/16E09C0 | 690 | table public.data: INSERT: id[integer ]:3 data[text]:'3'
123
123
0/16E0B90 | 690 | COMMIT 690
124
124
(3 rows)
125
125
@@ -128,7 +128,7 @@ postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, N
128
128
location | xid | data
129
129
-----------+-----+-----------------------------------------------
130
130
0/16E09C0 | 690 | BEGIN 690
131
- 0/16E09C0 | 690 | table public.data: INSERT: id[int4 ]:3 data[text]:'3'
131
+ 0/16E09C0 | 690 | table public.data: INSERT: id[integer ]:3 data[text]:'3'
132
132
0/16E0B90 | 690 | COMMIT 690 (at 2014-02-27 16:41:51.863092+01)
133
133
(3 rows)
134
134
@@ -155,7 +155,7 @@ CTRL-Z
155
155
# psql -c "INSERT INTO data(data) VALUES('4');"
156
156
# fg
157
157
BEGIN 693
158
- table public.data: INSERT: id[int4 ]:4 data[text]:'4'
158
+ table public.data: INSERT: id[integer ]:4 data[text]:'4'
159
159
COMMIT 693
160
160
CTRL-C
161
161
# pg_recvlogical -d testdb --slot test --drop
@@ -251,7 +251,7 @@ CTRL-C
251
251
SNAPSHOT</literal></link> to read the state of the database at the moment
252
252
the slot was created. This transaction can then be used to dump the
253
253
database's state at that point in time which afterwards can be updated
254
- using the slot's contents without loosing any changes.
254
+ using the slot's contents without losing any changes.
255
255
</para>
256
256
</sect2>
257
257
</sect1>
@@ -344,7 +344,7 @@ typedef void (*LogicalOutputPluginInit)(struct OutputPluginCallbacks *cb);
344
344
backend's normal infrastructure, including calling output functions. Read
345
345
only access to relations is permitted as long as only relations are
346
346
accessed that either have been created by <command>initdb</command> in
347
- the <literal>pg_catalog</literal> schema, or have are marked as user
347
+ the <literal>pg_catalog</literal> schema, or have been marked as user
348
348
provided catalog tables using
349
349
<programlisting>
350
350
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
368
the <literal>begin</literal> and <literal>commit</literal>
369
369
callbacks. Transactions that were rolled back explicitly or implicitly
370
370
never get
371
- decoded. Successfull <link linkend="SQL-SAVEPOINT">SAVEPOINTs</link> are
371
+ decoded. Successful <link linkend="SQL-SAVEPOINT">SAVEPOINTs</link> are
372
372
folded into the transaction containing them in the order they were
373
- exectuded within that transaction.
373
+ executed within that transaction.
374
374
</para>
375
375
<note>
376
376
<para>
@@ -385,7 +385,7 @@ CREATE TABLE another_catalog_table(data text) WITH (user_catalog_table = true);
385
385
<title>Startup Callback</title>
386
386
<para>
387
387
The optional <function>startup_cb</function> callback is called whenever
388
- an replication slot is created or asked to stream changes, independent
388
+ a replication slot is created or asked to stream changes, independent
389
389
of the number of changes that are ready to be put out.
390
390
<programlisting>
391
391
typedef void (*LogicalDecodeStartupCB) (
@@ -394,7 +394,7 @@ typedef void (*LogicalDecodeStartupCB) (
394
394
bool is_init
395
395
);
396
396
</programlisting>
397
- The <literal>is_init</literal> paramter will be true when the
397
+ The <literal>is_init</literal> parameter will be true when the
398
398
replication slot is being created and false
399
399
otherwise. <parameter>options</parameter> points to a struct of options
400
400
that output plugins can set:
0 commit comments