Your compute must be ready, and you need permission to read its connection information. The PostgreSQL password is separate from your PG Next sign-in password.
Get connection details
- Open your project and select Connect.
- Select the correct branch, compute, database and role.
- Choose an external connection for a personal computer or an application outside the cluster. Kubernetes internal addresses require access from the appropriate network.
- Check the host, port and SSL mode returned by the console. Use values for this compute; do not construct a host from the project name.
- Copy the connection string. If the button says Copy template, the string does not yet contain a real password. Add it privately before use.
A connection string containing a password is a secret. Do not share it in chat, commit it to Git or put it in a frontend VITE_* variable.
Use psql without putting a password in the command
Replace the illustrative values below with details from the console. This is not a real endpoint:
psql "host=HOST_FROM_CONSOLE port=PORT_FROM_CONSOLE dbname=DATABASE_FROM_CONSOLE user=ROLE_FROM_CONSOLE sslmode=SSL_MODE_FROM_CONSOLE" -WEnter the password at the prompt. Do not assume all endpoints support the same TLS mode, or lower the SSL mode just to bypass a certificate error. If your application needs stronger security than the endpoint provides, stop and verify the configuration with the operator.
SELECT current_database(), current_user;Both values should match your console selections. In an application, keep connection strings in server-side secret storage supported by your framework. Avoid exposing them in logs and error messages.
Troubleshoot a connection
| Symptom | What to check |
|---|---|
| Timeout or connection refused | Is the compute running? Do the host and port match the connection type? Can your network reach it? |
| Password authentication failed | Are the PostgreSQL role and current password correct? Did you fill in the template password? |
| Database does not exist | Does the string name a database that exists in this compute? |
| SSL or certificate error | Verify the endpoint’s SSL mode and certificate. Do not bypass verification to test quickly. |
Parameter syntax follows the PostgreSQL libpq documentation. PG Next TLS capabilities depend on the actual endpoint.