Supported platforms
Prerequisites
- A PostgreSQL instance reachable from CloudThinker over the network.
- Admin access to create a dedicated user and grant privileges.
- The
pg_stat_statementsextension installed if you want query-level analysis (required for slow-query data).
Setup
1
Connect as admin
Connect to your PostgreSQL instance using an admin account:
2
Create a read-only user
Create a dedicated user for CloudThinker:
3
Grant connection and schema access
Allow connection and schema usage:
4
Grant SELECT permissions
Grant SELECT on all tables and views, including future ones:
5
Enable pg_stat_statements
This extension is required for query analysis:For RDS/Aurora, add to your parameter group:
6
Configure network access
Ensure CloudThinker can reach your database:
- Add CloudThinker IPs to your security group or firewall
- For RDS: enable public access or use VPC peering
7
Add the connection in CloudThinker
Navigate to Connections → PostgreSQL and enter:
- Host: your database hostname or IP
- Port: database port (default:
5432) - Database: database name
- Username:
cloudthinker_readonly - Password: the password you set above
- SSL mode:
require(recommended)
Connection details
Connection string format:
Required permissions
Minimum
Recommended (full analysis)
Agent capabilities
Once connected, Tony can:Verify the connection
Example prompts
Troubleshooting
Connection refused
Connection refused
- Verify host and port are correct
- Check your security group or firewall allows CloudThinker IPs
- For RDS: ensure “Publicly accessible” is enabled or use VPC peering
- Confirm PostgreSQL is listening on the correct interface
Authentication failed
Authentication failed
- Verify username and password are correct
- Check
pg_hba.confallows the connection method - Ensure the user has
CONNECTprivilege on the database
Missing pg_stat_statements
Missing pg_stat_statements
- Verify the extension is installed:
SELECT * FROM pg_extension WHERE extname = 'pg_stat_statements'; - Check
shared_preload_librariesincludespg_stat_statements - Restart PostgreSQL after changing
shared_preload_libraries - For RDS: modify the parameter group and reboot the instance
Permission denied
Permission denied
- Verify the user has
SELECTon the required tables - Grant
pg_read_all_statsrole for PostgreSQL 14+ - Check schema permissions with
\dn+in psql
Security
- Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
- Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
- Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
- Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
- SSL required — always use SSL mode
requireor higher to encrypt data in transit. - Minimal grants — grant only
SELECTto the CloudThinker user; never grant write access.
Related
Tony Agent
Database-focused optimization agent
MySQL Connection
Similar setup for MySQL databases