Sources
PostgreSQL
Check which PostgreSQL versions SQL Flow can capture from, and what logical replication needs on your server.
SQL Flow captures changes from PostgreSQL through logical replication with the built-in pgoutput plugin. There is one capture mode, so the decisions on this page are about whether your server can run it.
Supported versions
| Version | Supported |
|---|---|
| PostgreSQL 14 and later | Yes |
| PostgreSQL 13 and earlier | No. SQL Flow uses a version of the logical replication protocol that PostgreSQL 14 introduced. |
Managed services
Managed PostgreSQL services such as Amazon RDS and Aurora, Azure Database for PostgreSQL and Google Cloud SQL can be sources when they meet the same requirements as any other server:
wal_level = logicaland a positivemax_slot_wal_keep_size, set through the service's server parameters.- A capture login with replication rights: the
REPLICATIONattribute, or membership in the service's replication role, such asrds_replicationon Amazon RDS and Aurora. - With Encryption at Require (default), a server certificate the agent can validate. If the service's certificates come from its own certificate authority, the agent host needs that authority's certificate. See Logical replication: Encrypted data.
Capture modes
| Mode | What it reads | What you install on the database host |
|---|---|---|
| Logical replication | Row changes decoded by PostgreSQL from the write-ahead log (WAL), streamed to the agent through a replication slot and a publication that SQL Flow creates | Nothing |
The wizard shows no Capture mode choice for PostgreSQL. When you pick PostgreSQL on the Source step, the form asks for Host, Port (default 5432), Database, Username, a password or a secret reference, and Encryption.
Choosing a capture mode
PostgreSQL has a single capture mode. Answer these questions to check that your server can run it.
- Is the server PostgreSQL 14 or later?
- No: upgrade the server.
- Yes: go to question 2.
- Can you set
wal_level = logicaland restart the server? Logical decoding is impossible without it.- No: PostgreSQL can't be a SQL Flow source.
- Yes: go to question 3.
- Can you set
max_slot_wal_keep_sizeto a positive size? SQL Flow refuses to create a replication slot while WAL retention is unbounded, because an abandoned slot could otherwise fill the server's disk.- No: PostgreSQL can't be a SQL Flow source.
- Yes: go to question 4.
- Can the capture login have replication rights and own (or be a member of the role that owns) the captured tables? PostgreSQL only lets a table's owner add it to a publication.
- Yes: use Logical replication.
- No: ask a DBA to create the role as described in Logical replication: Setup.
| Logical replication | |
|---|---|
| Server settings | wal_level = logical, positive max_slot_wal_keep_size, a free replication slot |
| Login | Replication rights, SELECT on the tables, ownership of the tables |
| Installed on the database host | Nothing |
| Holds on the source | A logical replication slot, which retains WAL until SQL Flow confirms it |
| Before-images of updates and deletes | Key columns by default; the whole row with REPLICA IDENTITY FULL |
TRUNCATE | Captured |
See Choosing a capture mode for the comparison across every source engine.
Encrypted data
| Logical replication | |
|---|---|
| Encrypted connection | Required by default, with the server certificate and host name validated. Encryption at Prefer relaxes this. |
| Storage-level encryption | Not visible to SQL Flow: the server decodes changes before it sends them. |
Column values encrypted by the application or with pgcrypto | Captured and copied as stored, that is, as ciphertext |
See Logical replication: Encrypted data for the Encryption choices and private certificate authorities, and Encrypted data support for every engine.
