🐘 PostgreSQL Connection
Connect your PostgreSQL database to Meza AI.
Overview
Connect your PostgreSQL database to Meza AI to sync your customer data. PostgreSQL is one of the most popular databases for B2B SaaS applications, and Meza AI supports all modern PostgreSQL versions.
Prerequisites
- PostgreSQL 10 or higher
- Database credentials with read access
- Network access to the database (whitelist Meza AI IPs if needed)
Connection Steps
Navigate to Databases
Go to Configuration → Databases in the left sidebar.
Add New Connection
Click Add Connection and select PostgreSQL from the list.
Enter Connection Details
Fill in the required connection parameters (see table below).
Test Connection
Click Test Connection to verify the settings work correctly.
Save
Click Save to complete the setup. Your database is now connected!
Connection Parameters
| Parameter | Description | Example |
|---|---|---|
| Host | Database server hostname or IP address | db.example.com |
| Port | PostgreSQL port (default: 5432) | 5432 |
| Database | Name of the database to connect to | myapp_production |
| Username | Database username with read access | meza_readonly |
| Password | Password for the database user | ******** |
| SSL Mode | SSL connection mode (require, verify-full, etc.) | require |
⚠️ Warning
Creating a Read-Only User
Run these SQL commands to create a read-only user for Meza AI:
-- Create the user CREATE USER meza_readonly WITH PASSWORD 'your_secure_password'; -- Grant connect privilege GRANT CONNECT ON DATABASE your_database TO meza_readonly; -- Grant usage on schema GRANT USAGE ON SCHEMA public TO meza_readonly; -- Grant select on all tables GRANT SELECT ON ALL TABLES IN SCHEMA public TO meza_readonly; -- Grant select on future tables ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO meza_readonly;
Whitelisting Meza AI IPs
If your database is behind a firewall, whitelist these Meza AI IP addresses:
34.102.136.180
35.247.10.205For AWS RDS, add these IPs to your security group inbound rules on port 5432. For Google Cloud SQL, add them to your authorized networks.
SSL Configuration
We recommend using SSL for all database connections. Common SSL modes:
| Mode | Description |
|---|---|
| require | Require SSL connection (recommended) |
| verify-ca | Require SSL and verify server certificate |
| verify-full | Require SSL, verify certificate, and verify hostname |
| disable | No SSL (not recommended for production) |
✅ Tip
Troubleshooting
Connection Timeout
If the connection times out, check that:
- Meza AI IPs are whitelisted in your firewall
- The database server is accessible from the internet
- The port (usually 5432) is open
Authentication Failed
If authentication fails, verify that:
- Username and password are correct
- The user has CONNECT privilege on the database
- pg_hba.conf allows connections from Meza AI IPs