You need to enable JavaScript to run this app.
RDS for PostgreSQL

RDS for PostgreSQL

Copy page
Download PDF
Extensions
Logical analysis (pg_decoderbufs)
Copy page
Download PDF
Logical analysis (pg_decoderbufs)
pg_decoderbufs is a logical decoding extension using the protocol buffer format.​
Usage restrictions​
pg_decoderbufs supports DML statements (Delete, Update, and Insert) only for logical decoding and the result is presented in the protocol buffer format.​
Extension options​
​
Options name​
debug-mode​
Description​
After performing logical decoding, output the decoded result in character mode.​
Examples​
​
select * from pg_logical_slot_peek_changes('demo', null, null, 'debug-mode', '1');​
select * from pg_logical_slot_get_changes('demo', null, null, 'debug-mode', '1');​
​
tip​
Refer to the following SQL query for definitions of pg_logical_slot_peek_changes and pg_logical_slot_get_changes functions:​
  • select * from pg_proc where proname = 'pg_logical_slot_peek_changes';​
  • select * from pg_proc where proname = 'pg_logical_slot_get_changes';​
​
Mapping relationship​
The mapping information between PostgreSQL types and decoderbuf fields is as follows:​
​
PostgreSQL Type OID​
Decoderbuf Field​
BOOLOID​
datum_boolean​
INT2OID​
datum_int32​
INT4OID​
datum_int32​
INT8OID​
datum_int64​
OIDOID​
datum_int64​
FLOAT4OID​
datum_float​
FLOAT8OID​
datum_double​
NUMERICOID​
datum_double​
CHAROID​
datum_string​
VARCHAROID​
datum_string​
BPCHAROID​
datum_string​
TEXTOID​
datum_string​
JSONOID​
datum_string​
XMLOID​
datum_string​
UUIDOID​
datum_string​
TIMESTAMPOID​
datum_string​
TIMESTAMPTZOID​
datum_string​
BYTEAOID​
datum_bytes​
POINTOID​
datum_point​
PostGIS geometry​
datum_point​
PostGIS geography​
datum_point​
​
Using extensions​
Prerequisites​
  • wal_level is set to logical.​
  • The table for logical analysis has a unique index, primary key, or a specified REPLICA IDENTITY.​
Extension usage​
  1. Create release and specify logical parsing extension as decoderbufs.​
  • ​
    select pg_create_logical_replication_slot('demo', 'decoderbufs');​
    ​
  1. Enable read/write and view logical parsing in debug-mode mode.​
  • ​
    select * from pg_logical_slot_peek_changes('demo', null, null, 'debug-mode', '1');​
    select * from pg_logical_slot_get_changes('demo', null, null, 'debug-mode', '1');​
    select * from pg_replication_slots;​
    ​
​
Last updated: 2026.01.13 18:44:18