Skip to main content
Version: 1.0.16

test_decoding

test_decoding is an example of a logical decoding output plugin. It can serve as a starting point for developing your own output plugin.

test_decoding receives WAL through the logical decoding mechanism and decodes it into a textual representation of the operations that were performed.

Typical output from this plugin might look like:

test=## SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'include-xids', '0');

location | 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)