Reference for connecting databases to Sequin
connect
permission on the database.select
permission on all the tables or schemas you want to connect to Sequin.replication
permission (to read from replication slots).logical
, you’ll need to enable it. The process for enabling logical replication varies by provider. You can find more information in the following guides:
postgresql.conf
to set wal_level = logical
rds.logical_replication = 1
publish_via_partition_root
is set to true
to ensure Sequin captures changes correctly. This means changes to partition tables are associated with the root table:
ALTER PUBLICATION
statement:
DROP PUBLICATION
statement:
REPLICA IDENTITY
to determine the old values of an updated row. These values are provided in the changes
field in messages.
REPLICA IDENTITY
set to FULL
, Sequin receives new and old values for all columns during updates. For columns that have changed values, Sequin includes the old values in the changes
field.
"unchanged_toast"
unless REPLICA IDENTITY
is set to FULL
REPLICA IDENTITY
is FULL
, all TOAST columns are included regardless of changesREPLICA IDENTITY
is set to FULL
REPLICA IDENTITY
to FULL
for a table:
pg_logical_emit_message
to ensure proper WAL checkpointing.
The only permission required for this is CONNECT
on the primary database.
pg_logical_emit_message
function for heartbeat messages and backfills. This function is included in Postgres 14 and later.
For Postgres 12 and 13, we support a table-based replacement: public.sequin_logical_messages
.
You can create this table in your database with the following SQL:
pg_logical_emit_message
function. It experiences very low write throughput and will not accumulate significant storage or IOPS.
This table must be included in your publication so that Sequin receives messages written to it. If you have created your publication with ALL TABLES
, then this is done automatically. Otherwise, you can add the table to your publication with the following SQL:
pg_logical_emit_message
function.
If you require backfills, we recommend upgrading to Postgres 14 or later. If this is not an option, please contact us to discuss alternative approaches.
ALTER PUBLICATION
documentation here.