Skip to main content

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.

  1. Go to Data Stores and click Connect New
  2. Select PostgreSQL
  3. Keep the connection mode set to Cloud (default)
  4. 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)
  5. Click Test Connection to verify connectivity
  6. Click Save

Connect via DataBridge Agent

In Agent mode, the DataBridge Agent handles the connection from within your infrastructure.

  1. Go to Data Stores and click Connect New
  2. Select PostgreSQL
  3. Switch the connection mode to Agent
  4. Fill in:
    • Name - a display label
    • Connection Alias - must match an alias defined in the agent's config.yaml
  5. Click Save

Configuration Reference

NameRequiredDescriptionDefault
HostYesDatabase hostname (without port)localhost
PortYesDatabase port5432
SSL ModeNoConnection encryption: disable or require(empty)
DatabaseYesTarget database namepostgres
UsernameYesDatabase username
PasswordYesDatabase password
SchemaYesPostgreSQL schema (search_path) for table creationpublic

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 TypePostgreSQL Column Type
stringTEXT
string with format: "date-time"TIMESTAMPTZ
integerBIGINT
numberDOUBLE PRECISION
booleanBOOLEAN
objectJSONB
arrayJSONB

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_addresses in postgresql.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.conf allows 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 USAGE and CREATE on 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., databridge or events) rather than public to keep DataBridge tables organized
  • For managed PostgreSQL services (AWS RDS, Google Cloud SQL, Azure Database for PostgreSQL), use require SSL mode
  • The connection timezone is set to UTC; all timestamps stored by DataBridge are in UTC