PostgreSQL
Measured connects to any PostgreSQL-compatible database: self-hosted Postgres, Amazon RDS, Aurora, Google AlloyDB, Supabase, Neon, and more.
Connection string format
postgresql://USER:PASSWORD@HOST:PORT/DATABASE
Examples:
# Self-hosted
postgresql://dq_user:secret@db.internal:5432/analytics
# Amazon RDS
postgresql://dq_user:secret@prod-db.cluster-abc123.us-east-1.rds.amazonaws.com:5432/analytics
# Supabase (direct connection)
postgresql://postgres.xyz:secret@aws-0-us-east-1.pooler.supabase.com:5432/postgres
# Neon
postgresql://dq_user:secret@ep-xyz.us-east-2.aws.neon.tech/analytics?sslmode=require
SSL
Most cloud Postgres instances require SSL. Add ?sslmode=require or ?sslmode=verify-full to the connection string:
postgresql://user:pass@host:5432/db?sslmode=require
For verify-full, you may also need to provide a root CA certificate. Set the PGSSLROOTCERT environment variable on your Measured container, or use the advanced connection options in the UI.
Required permissions
Create a dedicated read-only user:
-- Create role
CREATE ROLE dq_cloud_role;
-- Grant schema access
GRANT USAGE ON SCHEMA public TO dq_cloud_role;
-- Grant table access (existing tables)
GRANT SELECT ON ALL TABLES IN SCHEMA public TO dq_cloud_role;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO dq_cloud_role;
-- Create user
CREATE USER dq_cloud_svc WITH PASSWORD 'strongpassword';
GRANT dq_cloud_role TO dq_cloud_svc;
For monitoring multiple schemas, repeat the GRANT USAGE and GRANT SELECT for each schema.
Connection pooling
If your Postgres instance uses PgBouncer or another connection pooler in transaction mode, add ?options=-c%20search_path%3Dpublic to the connection string and ensure the pooler is configured for at least 2 connections per Measured instance.
Troubleshooting
FATAL: password authentication failed
Check username and password. For RDS, the password must not contain special characters that need URL-encoding without encoding them.
FATAL: no pg_hba.conf entry for host
Add an entry to pg_hba.conf to allow connections from your Measured host:
host analytics dq_cloud_svc 10.0.1.0/24 md5
Connection timeouts
Check security groups (AWS), firewall rules, or VPC peering between your Measured host and the database.