Prerequisites
- A PostgreSQL database (version 12 or later recommended) that is accessible over the network
- The database host, port, name, username, and password
- A VexiData account
Connect PostgreSQL to VexiData
Gather your connection details
You need five pieces of information to connect. If you set up PostgreSQL yourself, you’ll already know these. If someone else manages the database, ask your database administrator.
| Parameter | Description | Default |
|---|---|---|
| Host | The hostname or IP address of your PostgreSQL server | localhost |
| Port | The port PostgreSQL is listening on | 5432 |
| Database | The name of the database you want to query | postgres |
| Username | A PostgreSQL user with access to the database | postgres |
| Password | The password for that user | — |
Allow VexiData through your firewall (if applicable)
If your PostgreSQL server is behind a firewall or only accepts connections from specific IPs, add VexiData’s IP addresses:
139.59.53.167165.22.217.42
- Cloud VMs (AWS EC2, DigitalOcean Droplets, GCP Compute) — Security Groups or firewall rules
- Self-hosted servers —
pg_hba.confand/or your OS firewall (e.g.,ufw,iptables) - Managed databases — See the provider-specific guides linked above
If your database is only accessible from
localhost or a private network, you’ll need to either expose it to the internet or set up an SSH tunnel. VexiData requires a direct TCP connection to your database.Verify PostgreSQL accepts remote connections
By default, PostgreSQL only listens on
localhost. If your database is on a remote server, make sure it’s configured to accept external connections:- In
postgresql.conf, set:
- In
pg_hba.conf, add a line allowing VexiData’s IPs (or all IPs if behind a firewall):
- Restart PostgreSQL for changes to take effect.
Managed database services (Supabase, Neon, RDS, etc.) handle this automatically. You only need this step for self-hosted PostgreSQL.
Add the connection in VexiData
- Go to Data Sources in VexiData
- Click PostgreSQL to open the connection form
- Fill in the details:
| Field | Value |
|---|---|
| Display Name | A name to identify this connection (e.g., “Production DB”) |
| Host | Your server’s hostname or IP address |
| Port | 5432 (or your custom port) |
| Database | Your database name |
| Schema | public (default — change if your tables are in a different schema) |
| Username | Your PostgreSQL username |
| Password | Your PostgreSQL password |
Creating a read-only user (recommended)
For security, we recommend connecting VexiData with a dedicated read-only user instead of your admin or application user. This ensures VexiData can only read data, never modify it.public with your schema name in the commands above.
Troubleshooting
Connection timed out
Connection timed out
This means VexiData can’t reach your server. Check:
- Your firewall allows inbound connections on the PostgreSQL port from VexiData’s IPs
listen_addressesinpostgresql.confis set to'*'(not'localhost')- Your server has a public IP or hostname that resolves correctly
- If on a cloud VM, the Security Group / firewall rules allow traffic on port
5432
Authentication failed
Authentication failed
- Verify the username and password are correct
- Check
pg_hba.confallows the authentication method you’re using (e.g.,scram-sha-256ormd5) for remote connections - Some setups use
peeroridentauthentication which only works for local connections — remote connections need password-based auth
Database does not exist
Database does not exist
- PostgreSQL is case-sensitive for database names. Make sure the name matches exactly (e.g.,
MyAppis different frommyapp) - Run
\linpsqlto list all available databases
No tables visible after connecting
No tables visible after connecting
- Confirm your tables are in the
publicschema. If they’re in a custom schema (e.g.,apporapi), update the Schema field in VexiData - Check that your user has
SELECTpermissions:GRANT SELECT ON ALL TABLES IN SCHEMA public TO your_user;
SSL required / SSL connection errors
SSL required / SSL connection errors
- If your server requires SSL, VexiData will attempt SSL automatically
- For self-hosted servers, ensure your PostgreSQL SSL certificates are properly configured
- Check that
ssl = onis set inpostgresql.confif you require encrypted connections