pg_create_logical_replication_slot
select * from pg_replication_slots;
select pg_export_snapshot();
select pg_create_logical_replication_slot(‘logical_slot1’, ‘test_decoding’);
CREATE TABLE t_logical(id int4);
pg_logical_slot_get_changes
SELECT * FROM pg_logical_slot_get_changes(‘logical_slot1’, null, null);
pg_logical_slot_peek_changes
INSERT INTO t_logical VALUES (1);
SELECT * FROM pg_logical_slot_peek_changes(‘logical_slot1’, null, null);
ERROR: logical decoding cannot be used while in recovery
pg_drop_replication_slot
SELECT pg_drop_replication_slot(‘logical_slot1’);