Connect to Artie
Requirements
- A PlanetScale Postgres database
- Database or organization administrator access, to change cluster parameters
- Access to your branch’s default role
- An Artie account
Network access
If your database uses IP restrictions, add Artie’s fixed IP addresses to the allowlist before you connect. IP restrictions are set per database. To connect over a private network instead, set up AWS PrivateLink with Artie’s PrivateLink guide. Use your branch’s Private Host (*.private-pg.psdb.cloud) as the host when you connect.
Configure your PlanetScale cluster
Set cluster parameters
To enable logical replication, configure these parameters in your branch’s Clusters > Parameters tab:wal_level, max_replication_slots, and max_wal_senders require a restart.
Queue all three changes with “Queue parameter changes”, then click “Apply changes” once so the cluster restarts once.
On production clusters, PlanetScale performs a rolling restart, which terminates direct connections during a brief switchover.
After the cluster restarts, verify the WAL level:
logical.
Create a replication user
Connect to the primary as the default role on port5432 and create a dedicated user for Artie:
GRANT SELECT and ALTER DEFAULT PRIVILEGES statements as that role too.
PlanetScale routes connections by branch, so append your branch ID to log in: artie_transfer.<branch_id>.
It’s the suffix on your default role’s username, such as postgres.12345678.
In SQL, use artie_transfer without it.
Roles created via SQL do not appear on the Settings > Roles page and must be managed directly in Postgres.
A user-defined role can only have the
REPLICATION attribute if it inherits postgres, so this SQL user is the least-privileged option.Create a heartbeat table (optional)
Artie’s replication slot only advances when a published table changes. If those tables can go hours without writes while the rest of the database keeps writing, the slot holds back WAL. To prevent this, create a heartbeat table, which Artie updates every 5 minutes. Skip this if your published tables change regularly. As the default role, run:Create a publication
Artie only creates the publication itself when its user is a superuser. The PlanetScale role isn’t one, so create it as the default role. Artie uses a publication nameddbz_publication unless you pick another one when you connect.
List the tables that would be affected:
FULL on each one, or leave them out of a publication of specific tables:
Set up Artie
- In PlanetScale, navigate to your database and branch, and click the “Connect” button. Leave this tab open, as you’ll need the host shortly.
-
In the Artie dashboard, create a new pipeline and select “PostgreSQL” as the source.
Artie’s PlanetScale source is for PlanetScale Vitess databases. For PlanetScale Postgres, use the PostgreSQL source.
-
Fill in the connection information. TLS is enforced automatically, so no additional TLS configuration is required.
- Host: Paste in the host from the PlanetScale Connect page, for example
xxxxxxxxxx-useast1-1.horizon.psdb.cloud. If you use PrivateLink, use the Private Host instead. - Port:
5432 - User:
artie_transfer.<branch_id> - Password: The password you set for
artie_transfer - Database name: Select the database your tables are in (
postgresby default)
- Host: Paste in the host from the PlanetScale Connect page, for example
-
For Publication, select
dbz_publicationfrom the list. Artie sets Publication mode and Publish via partition root to match. If you set them by hand, they must match the publication, or deployment fails validation, for example withplease set the publication mode to 'all tables' to match the existing publication. -
Under Advanced options:
- Turn on Failover slot, so Artie creates its replication slot with
failover = true. PlanetScale requires this for the slot to survive a switchover or failover. This setting doesn’t change a slot that already exists. See Enable failover on an existing slot. - If you created a heartbeat table, turn on Heartbeats. Artie shows SQL for the heartbeat table, which you already ran, so you can skip it.
- Turn on Failover slot, so Artie creates its replication slot with
-
Select the tables you want to replicate. For a table without a primary key, set Override primary keys in its table settings and set the table to
REPLICA IDENTITY FULL. Otherwise, deployment fails withthe following tables are missing primary keys. - Select your destination, review the pipeline settings, and click “Deploy.”
Sync overview
Artie starts the initial copy and change capture together:- Backfill: Artie reads the selected tables and loads their existing rows into your destination.
- Streaming: Artie reads inserts, updates, and deletes from its replication slot while the backfill is running and afterward.
Manage your pipeline
Enable failover on an existing slot
A slot that Artie created before Failover slot was turned on hasfailover = false.
Using the default role, check Artie’s slot:
failover column shows f:
- In Artie, pause the pipeline with Pause reading & delivery so it releases the slot. The default, Pause delivery only, stays connected to the slot.
- Follow Enabling failover on an existing replication slot.
- Resume the pipeline. Artie continues from its last acknowledged position.
Pausing a pipeline
While a pipeline is paused with Pause reading & delivery, its slot holds back WAL. Keep pauses short:- If Artie falls further behind than
max_slot_wal_keep_size, Postgres invalidates the slot. Artie can no longer resume from it, and the pipeline needs a new slot and a backfill. - A failover can proceed before an idle slot is synced to the new primary, which risks losing the slot.
logical_slot_sync_timeoutbounds how long a failover waits for slot sync. For more details, see Postgres High Availability with CDC.
Removing a pipeline
Artie doesn’t drop its replication slot or your publication when you delete a pipeline. After the pipeline has disconnected, check whether its slot still exists and drop it so it stops holding WAL. As the default role, run:artie and dbz_publication with your own names if you changed them in Artie.
Postgres can’t drop a slot while it’s active.
Only drop the publication if no other pipeline uses it.
Branches
Artie’s credentials target one branch, so each branch needs its own pipeline. A new, empty branch doesn’t include the parameters, user, heartbeat table (if you use one), or publication from these steps, so repeat them on that branch and create a separate Artie pipeline with its credentials. The branch ID in the username changes too. A branch restored from a backup includes the backup’s data, soartie_transfer, the heartbeat table, and the publication may already exist there.
Check them before you repeat these steps.

