mirror of
https://github.com/postgres/postgres.git
synced 2026-05-28 04:35:45 -04:00
Per discussion, "location" is a rather vague term that could refer to multiple concepts. "LSN" is an unambiguous term for WAL locations and should be preferred. Some function names, view column names, and function output argument names used "lsn" already, but others used "location", as well as yet other terms such as "wal_position". Since we've already renamed a lot of things in this area from "xlog" to "wal" for v10, we may as well incur a bit more compatibility pain and make these names all consistent. David Rowley, minor additional docs hacking by me Discussion: https://postgr.es/m/CAKJS1f8O0njDKe8ePFQ-LK5-EjwThsDws6ohJ-+c6nWK+oUxtg@mail.gmail.com
42 lines
1.3 KiB
Text
42 lines
1.3 KiB
Text
<!-- doc/src/sgml/test-decoding.sgml -->
|
|
|
|
<sect1 id="test-decoding" xreflabel="test_decoding">
|
|
<title>test_decoding</title>
|
|
|
|
<indexterm zone="test-decoding">
|
|
<primary>test_decoding</primary>
|
|
</indexterm>
|
|
|
|
<para>
|
|
<filename>test_decoding</> is an example of a logical decoding
|
|
output plugin. It doesn't do anything especially useful, but can serve as
|
|
a starting point for developing your own decoder.
|
|
</para>
|
|
|
|
<para>
|
|
<filename>test_decoding</> receives WAL through the logical decoding
|
|
mechanism and decodes it into text representations of the operations
|
|
performed.
|
|
</para>
|
|
|
|
<para>
|
|
Typical output from this plugin, used over the SQL logical decoding
|
|
interface, might be:
|
|
|
|
<programlisting>
|
|
postgres=# SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'include-xids', '0');
|
|
lsn | xid | data
|
|
-----------+-----+--------------------------------------------------
|
|
0/16D30F8 | 691 | BEGIN
|
|
0/16D32A0 | 691 | table public.data: INSERT: id[int4]:2 data[text]:'arg'
|
|
0/16D32A0 | 691 | table public.data: INSERT: id[int4]:3 data[text]:'demo'
|
|
0/16D32A0 | 691 | COMMIT
|
|
0/16D32D8 | 692 | BEGIN
|
|
0/16D3398 | 692 | table public.data: DELETE: id[int4]:2
|
|
0/16D3398 | 692 | table public.data: DELETE: id[int4]:3
|
|
0/16D3398 | 692 | COMMIT
|
|
(8 rows)
|
|
</programlisting>
|
|
</para>
|
|
|
|
</sect1>
|