PostgreSQL
PostgreSQL is a free and open-source relational database management system emphasizing extensibility and SQL compliance. It works well as a DataBridge destination for general-purpose analytics, operational dashboards and development environments.
Connect via Cloud Mode
In Cloud mode, DataBridge connects directly to your PostgreSQL instance.
- Go to Data Stores and click Connect New
- Select PostgreSQL
- Keep the connection mode set to Cloud (default)
- Fill in the connection details:
- Name - a display label (e.g., "PostgreSQL Production")
- Host with port - hostname and port (e.g.,
pg.example.com:5432) - Username and Password
- Database - target database name (e.g.,
analytics)
- Click Test Connection to verify connectivity
- Click Save
Connect via DataBridge Agent
In Agent mode, the DataBridge Agent handles the connection from within your infrastructure.
- Go to Data Stores and click Connect New
- Select PostgreSQL
- Switch the connection mode to Agent
- Fill in:
- Name - a display label
- Connection Alias - must match an alias defined in the agent's
config.yaml
- Click Save
Configuration Reference
| Name | Required | Description | Default |
|---|---|---|---|
| Host | Yes | Database hostname (without port) | localhost |
| Port | Yes | Database port | 5432 |
| SSL Mode | No | Connection encryption: disable or require | (empty) |
| Database | Yes | Target database name | postgres |
| Username | Yes | Database username | |
| Password | Yes | Database password | |
| Schema | Yes | PostgreSQL schema (search_path) for table creation | public |
Schema-Driven Column Types
When a JSON Schema is registered for an event, DataBridge maps each top-level property to a native PostgreSQL column type:
| JSON Schema Type | PostgreSQL Column Type |
|---|---|
string | TEXT |
string with format: "date-time" | TIMESTAMPTZ |
integer | BIGINT |
number | DOUBLE PRECISION |
boolean | BOOLEAN |
object | JSONB |
array | JSONB |
Every table also includes two metadata columns: ref_url_id TEXT and event_id TEXT.
Nested objects and arrays are stored as JSONB, which supports PostgreSQL's JSON operators and indexing. If no schema is registered, the table falls back to the simplified three-column layout (ref_url_id, event_id, payload).
Required Permissions
The database user needs permission to create and write tables in the target schema:
-- Grant necessary privileges
GRANT USAGE ON SCHEMA events TO databridge_user;
GRANT CREATE ON SCHEMA events TO databridge_user;
GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA events TO databridge_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA events
GRANT SELECT, INSERT, UPDATE ON TABLES TO databridge_user;
Testing the Connection
In Cloud mode, click Test Connection in the connection dialog before saving.
In Agent mode, verify from the agent host:
psql "host=your-pg-host port=5432 dbname=analytics user=databridge_user sslmode=require"
Troubleshooting
Connection timed out
- Verify the host and port are correct
- Check that your PostgreSQL instance accepts remote connections (
listen_addressesinpostgresql.conf) - Ensure firewall rules or security groups allow traffic on port 5432
- For managed services (RDS, Cloud SQL, etc.), check that the instance is publicly accessible or that DataBridge IPs are whitelisted
Authentication failed
- Confirm the username and password
- Check
pg_hba.confallows the connection method (md5, scram-sha-256) from the DataBridge IP range
Permission denied on schema
- Ensure the schema exists:
CREATE SCHEMA IF NOT EXISTS events; - Grant
USAGEandCREATEon the schema to the user
SSL connection errors
- If your database requires SSL, set SSL Mode to
require - If SSL is not configured on the server, set SSL Mode to
disable - For managed databases (RDS, Cloud SQL), SSL is typically required by default
Tips
- Use a dedicated schema (e.g.,
databridgeorevents) rather thanpublicto keep DataBridge tables organized - For managed PostgreSQL services (AWS RDS, Google Cloud SQL, Azure Database for PostgreSQL), use
requireSSL mode - The connection timezone is set to UTC; all timestamps stored by DataBridge are in UTC