How to set up PostgreSQL
Prerequisites
Before connecting PostgreSQL to Cargo, ensure you have:- An active PostgreSQL server (version 9.6 or higher)
- Network connectivity between Cargo and your PostgreSQL server
- A database user with appropriate permissions
- SSL enabled for secure connections (recommended)
Connection details
To set up the connection, provide the following details when creating the connector:- Standard PostgreSQL
- Supabase
- Neon
Use your PostgreSQL server’s hostname and credentials directly.
PostgreSQL actions
Once connected, you can use PostgreSQL in your workflows with the following actions:Insert
Insert new records into a PostgreSQL table. Configuration
Use cases
- Lead capture – Insert new leads from form submissions or enrichment workflows
- Event logging – Record workflow events and outcomes
- Data aggregation – Store computed results for reporting
Update
Update existing records in a PostgreSQL table based on a matching column. Configuration
Use cases
- Data enrichment – Update records with enriched data from external sources
- Status updates – Mark records as processed or update stages
- Sync external changes – Keep PostgreSQL in sync with CRM or other systems
Upsert
Create new records or update existing ones based on a matching column. Uses PostgreSQL’s nativeON CONFLICT clause for optimal performance.
Configuration
Use cases
- Data sync – Keep your database updated regardless of whether records exist
- Idempotent operations – Safely retry operations without creating duplicates
- Master data management – Maintain a single source of truth
The upsert action requires a unique constraint or primary key on the matching column.
Delete
Delete records from a PostgreSQL table based on a matching column. Configuration
Use cases
- Data cleanup – Remove outdated or invalid records
- GDPR compliance – Delete personal data on request
- Workflow automation – Remove processed records from staging tables
PostgreSQL data models
Cargo allows you to create data models on top of your PostgreSQL data that can be used to trigger Plays and power workflows.Creating PostgreSQL data models
To create a PostgreSQL data model:- Navigate to Data Models in Cargo
- Click Create data model
- Select PostgreSQL as the source
- Configure the following fields:
Using PostgreSQL data models
Once created, your PostgreSQL data model can be used to:- Trigger Plays – Start automated workflows when data changes
- Power enrichment – Use PostgreSQL data to enrich records in workflows
- Create segments – Filter and target specific records from your data
Database user setup
For best security practices, create a dedicated user with only the necessary permissions:Network configuration
If you restrict access to your PostgreSQL server, add these Cargo IP addresses to your firewall or security group:3.251.34.13454.220.135.9979.125.105.52
- Supabase
- AWS RDS
- Standard PostgreSQL
In Supabase, network restrictions are configured in Project Settings → Database → Network restrictions.
Security
- All PostgreSQL connections can be encrypted using SSL/TLS
- Credentials are securely stored and encrypted at rest
- Cargo uses dedicated user credentials with minimal required permissions
- We recommend enabling SSL and using strong passwords

