PostgreSQL
LIVE Source
Overview
Section titled “Overview”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.
Features
Section titled “Features”| Feature | Supported | Notes |
|---|---|---|
| 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. |
Before you connect
Section titled “Before you connect”-
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 replicateGRANT 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 PRIVILEGESline makes tables created later readable too. -
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.
-
Use TLS. PortPilot connects with
ssl_mode: requireunless you change it.
Connect
Section titled “Connect”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.
Schema
Section titled “Schema”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 type | Lands as |
|---|---|
bigint | integer |
bigserial | integer |
bool | boolean |
boolean | boolean |
decimal | number |
double precision | number |
float | number |
float4 | number |
float8 | number |
int | integer |
int2 | integer |
int4 | integer |
int8 | integer |
integer | integer |
json | object |
jsonb | object |
money | number |
numeric | number |
real | number |
serial | integer |
smallint | integer |
smallserial | integer |
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.
Sync behavior
Section titled “Sync behavior”| 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"]).
Common gotchas
Section titled “Common gotchas”- 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_atcolumn) if you need them downstream. updated_atmust change on every write. Rows updated without touching it are missed by incremental syncs. A trigger that setsupdated_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.ordersandbilling.orderscollide. 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’ssearch_path:ALTER ROLE portpilot SET search_path = public, sales; numericprecision.numeric/decimalcolumns 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_delayif you seecanceling statement due to conflict with recovery.