Connection fields
| Field | Required | Description |
|---|---|---|
host | yes | Hostname or IP address of the Postgres instance |
port | no | Defaults to 5432 |
database | yes | Database name |
username | yes | Role used to connect — needs SELECT on source schemas plus full DML/DDL on a Traffical-owned schema (see below) |
password | yes | Password for the role |
sslMode | no | Defaults to require. Set to disable only for local development |
connectionString in standard postgresql://... form. The pipeline uses whichever you provide.
Configure these in Settings → Warehouse → Postgres.
Creating the role and the Traffical schema
The pipeline needs read access to your data plus a Traffical-owned schema it can read and write. Run this inpsql as a privileged user:
analytics with whichever schema your assignment and fact tables live in. Grant SELECT on each source schema the pipeline needs to read.
Once the pipeline runs once, it owns a traffical schema where it creates, reads, and drops materialization and staging tables. The role only needs default privileges in that schema since it’s the schema’s creator. If you prefer to lock things down further, pre-create the schema and grant explicitly:
Network access
Traffical’s pipeline egress IPs are listed in the dashboard under Settings → Warehouse. Allow these IPs through any firewall, security group, or VPC gateway:- Managed Postgres (RDS / Cloud SQL / Azure Database / Neon / Supabase) — usually a security group rule or IP allowlist setting.
- Self-managed —
pg_hba.confplus your network ACLs.
SSL
sslMode: require is the default and recommended. The pipeline expects a TLS connection. Postgres clients also support verify-ca and verify-full — those are coming, but for now require is the supported setting.
Recommended schema layout
Two tables typically anchor a Postgres warehouse-native setup:assigned_at and event_time are important if your tables are large, because the pipeline filters by time.
Example definitions
Assignment definition SQL:{{start_date}} / {{end_date}} template variables are replaced by the pipeline at run time with the window it’s processing.
Performance tips
- Index on time columns. The pipeline always filters by time; without an index it’ll do a sequential scan.
- Compose your SQL to scan one date partition if you’re using
pg_partmanor another partitioning scheme. The template variables make this straightforward. - Avoid
SELECT *. Project only the columns the pipeline needs — it doesn’t use more than what yourSELECTlist provides.
Gotchas
- Timezones. Make sure your time columns are
TIMESTAMPTZ, notTIMESTAMPwithout timezone. Comparisons in the template variables are timezone-aware. - Long-running transactions. The pipeline opens a connection, runs a query, and disconnects. It won’t hold a transaction open, so you don’t need to worry about long-running PgBouncer sessions — but if you’re behind PgBouncer in transaction mode, make sure your queries are simple enough to complete in one round trip.
- Read replicas. Pointing Traffical at a read replica is fine and recommended for cost isolation. Replication lag means the pipeline sees slightly stale data — usually a non-issue for analytics.