Handling logical replication slots

Logical replication slots are essential to logical replication. Due to space limitations in this chapter it is unfortunately not possible to cover all aspects of logical replication. However, I want to outline some of the basic concepts that are essential for logical decoding and therefore also for logical replication.

If you want to create a replication slot, here is how it works. The function needed here takes two parameters: the first one will define the name of the replication slot, while the second one carries the plugin used to decode the transaction log. It will determine the format PostgreSQL is going to use to return the data:

test=# SELECT * FROM pg_create_logical_replication_slot('logical_slot', ...

Get Mastering PostgreSQL 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.