How it works…

The first of our queries for checking status will provide a lot of information about the subscription, but is of somewhat limited utility. Here's an example from our test system:

Note that the status field indicates the subscription is initializing. Everything else is basically a static field indicating some information about the subscription itself. When the subscription is complete, the status field will display replicating instead. It's not much in the way of diagnostics, but does at least confirm the subscription is still establishing itself.

The next check we can perform using the pg_database_size function is a very coarse ...

Get PostgreSQL 12 High Availability Cookbook 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.