How it works...
We start by creating event_log as our first table on pgha1. Those of you who are familiar with logical replication know that DDL is not part of the replication stream; however, it is possible to intercept DDL within PostgreSQL itself and trigger the actions afterward.
As a result, BDR captures DDL events and adds them to the replication stream as part of the logical output. The receiving node understands that this isn't standard replicated data and applies the DDL locally. Assuming that everything worked properly, we should see this table appear on pgha2 as well.
Next, we create an index on the event_dt column because we want to be able to quickly locate events by date. The only difference here is that we applied the change ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access