DBInn · PostgreSQL 18
How to connect to a PostgreSQL database
A practical introduction to connecting a standard PostgreSQL client to a hosted database. DBInn's console is coming soon; the commands below are examples, not live credentials.
1. Collect the connection information
You need the database host, port, database name, username and password. When DBInn is available, use the connection information displayed in the console. The standard PostgreSQL port is 5432, but always use the port provided for your database. Keep the password private.
2. Connect with psql and TLS
Install a compatible PostgreSQL client and use the example command below. Replace HOST, PORT, DATABASE, USERNAME and PATH_TO_CA_CERT with the real values and the trusted CA certificate path for your service. Enter the password when prompted; do not put it on the command line. The verify-full mode checks both the certificate chain and hostname.
Example psql command — replace all placeholders
psql "host=HOST port=PORT dbname=DATABASE
user=USERNAME sslmode=verify-full
sslrootcert=PATH_TO_CA_CERT"3. Connect with a graphical client or an application
In DBeaver or TablePlus, select PostgreSQL, enter the same host, port, database name and username, and configure certificate and hostname verification in the client's TLS settings. Applications can use a standard PostgreSQL driver. Store connection secrets in a secure configuration or secret store, not in client-side code.
4. Diagnose common connection errors
If the connection times out, check the host, port and network access. If authentication fails, confirm the username, database name and password. If certificate verification fails, check the trusted CA and hostname; do not disable verification to bypass the problem. If the database connection limit is reached, close idle connections or configure a suitable small connection pool.
5. Test and close the connection
After connecting, run SELECT version(); to verify that the PostgreSQL server responds, then use \q to leave psql. This test does not modify your database. Use the official PostgreSQL documentation below for details on libpq connection options and certificate verification.