Key | Description | Sample Value |
---|---|---|
database | Name of the database you want to extract data from. | demo |
host | Hostname of your PostgreSQL database. | db.bit.io |
password | Password for the PostgreSQL user. | abc123... |
port | Port number where the database is accessible (typically 5432 ). | 5432 |
schema | Schema containing the tables you want to extract. | public |
username | Username with permissions to read and write from the specified schema. | guest |
replication_slot | Logical replication slot name for Change Data Capture (CDC). | mage_slot |
publication_name | Logical replication publication name for CDC. | mage_pub |
Key | Description | Sample Value |
---|---|---|
batch_fetch_limit | Number of rows to fetch per batch (default is 50,000). Adjust if your instance has sufficient memory. | 50000 |
SELECT
, WHERE
, and ORDER BY
statements.
postgresql.conf
file. Here is an example location on Mac OSX:
/Users/Mage/Library/Application Support/Postgres/var-14/postgresql.conf
.
wal_level
to logical
. The line in your
postgresql.conf
file should look like this:
SHOW wal_level
. The result should be:
wal_level |
---|
logical |
wal_level
= logical
max_replication_slots
≥ 1max_wal_senders
≥ 1mage_slot
quoted is used as an example in the guide. The actual replication slot name should be unique for each pipeline source.
The result should looking something like this:
pg_create_logical_replication_slot |
---|
(mage_slot,0/51A80778) |
mage_pub
is used in Mage’s code
or for 1 table:
some_schema
with the schema of the table and some_table_name
with the name
of the table you want to replicate.
Run the following command to add or remove a table from publication.
pubname | schemaname | tablename |
---|---|---|
mage_pub | public | users |
LOG_BASED
as the
replication method.
INSERT
command to add rows. For example:
some_schema
with the schema of the table and some_table_name
with the name
of the table you want to replicate.
Change the VALUES
to match the columns in your table.