Skip to content

PostgreSQL

LIVE Source

PortPilot reads every table you select from a PostgreSQL database and loads it into your destination. Tables with a primary key and an updated_at column sync incrementally; the rest are re-read in full on each sync. Reads stream through a server-side cursor, so large tables don’t load into memory at once.

Works with self-managed PostgreSQL and managed services (Amazon RDS and Aurora, Cloud SQL, AlloyDB, Supabase, Neon), as long as PortPilot can reach the database over the network.

FeatureSupportedNotes
Incremental sync Partly Tables with a primary key and an updated_at column; others are re-read.
Captures deletes No Records deleted in the source stay in the destination.
Custom fields Yes Every column of every selected table.
Table selection Yes Choose which tables to sync.
New columns added automatically Yes Columns that appear in the source are added to the destination table.
Re-sync Yes A full refresh re-reads every selected table.
  1. Create a read-only user for PortPilot:

    CREATE USER portpilot WITH PASSWORD '<strong password>';
    GRANT CONNECT ON DATABASE <database> TO portpilot;
    -- repeat for each schema you want to replicate
    GRANT USAGE ON SCHEMA public TO portpilot;
    GRANT SELECT ON ALL TABLES IN SCHEMA public TO portpilot;
    ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO portpilot;

    The ALTER DEFAULT PRIVILEGES line makes tables created later readable too.

  2. Allow network access. Allowlist PortPilot’s egress IPs (shown on the connection screen) in your firewall, security group or authorized networks. With a bring-your-own-cloud deployment, allow traffic from your own PortPilot agent’s network instead.

  3. Use TLS. PortPilot connects with ssl_mode: require unless you change it.

In the app, go to Connectors → New connector → PostgreSQL, fill in the fields below and click Test connection. The test checks network reachability, login, and lists the tables PortPilot can see.

Field Required Default Description
host Yes — Hostname or IP address of the database.
port Yes 5432 Port number.
database Yes — Database name.
user Yes — The read-only user created above.
password Yes — Stored write-only in the data plane’s secret store; PortPilot can’t read it back.
ssl_mode No require require, verify-full or disable.
schemas No all Schemas to replicate. System schemas are always excluded.
replication_key_columns No ["updated_at"] Columns to sync incrementally on, in priority order. [] re-reads every table on every sync.

Then pick a destination, a sync frequency and the tables to sync, and click Create & start initial sync.

PortPilot replicates your tables as they are: one destination table per source table, same column names, primary key copied from the source. Array types (int[], text[], …) land as arrays; every other type (text, uuid, timestamps, dates, …) lands as a string.

Type mapping (22 source types)
Source typeLands as
bigintinteger
bigserialinteger
boolboolean
booleanboolean
decimalnumber
double precisionnumber
floatnumber
float4number
float8number
intinteger
int2integer
int4integer
int8integer
integerinteger
jsonobject
jsonbobject
moneynumber
numericnumber
realnumber
serialinteger
smallintinteger
smallserialinteger

Any type not listed lands as a string.

Timestamps and dates land as strings; BigQuery loads them as TIMESTAMP/DATE, other destinations as text. numeric and decimal land in a floating-point column.

Table has Each sync Write mode
Primary key and an updated_at (timestamp, date or integer) column Rows where updated_at >= the previous maximum Upsert on the primary key
Primary key, no updated_at Whole table Upsert on the primary key
No primary key Whole table Replace (truncate and load)

The first sync of every table reads it in full. Change replication_key_columns if your application tracks changes in a different column (for example ["modified_at", "updated_at"]).

  • Deletes aren’t replicated. PortPilot reads tables with queries, not from the write-ahead log, so a row deleted at the source stays in the destination. Use soft deletes (a deleted_at column) if you need them downstream.
  • updated_at must change on every write. Rows updated without touching it are missed by incremental syncs. A trigger that sets updated_at = now() is the reliable fix.
  • Same table name in two schemas. Destination tables are named after the table only, not the schema, so sales.orders and billing.orders collide. Replicate them in separate connections, each writing to a different destination schema or dataset.
  • Tables outside public. Tables are queried without a schema prefix, so tables in other schemas must be on the user’s search_path: ALTER ROLE portpilot SET search_path = public, sales;
  • numeric precision. numeric/decimal columns land in a floating-point column, so values with more than ~15 significant digits lose precision. Timestamps land as text (except in BigQuery); cast them in your warehouse.
  • Large tables without a primary key are re-read and replaced in full on every sync, which costs compute you pay for. Add a primary key where you can.
  • Read replicas: pointing PortPilot at a replica keeps load off your primary. Long syncs on a hot standby can be cancelled by recovery conflicts; raise max_standby_streaming_delay if you see canceling statement due to conflict with recovery.