- 1 Minute to read
-
Print
-
DarkLight
-
PDF
PostgreSQL Connection
- 1 Minute to read
-
Print
-
DarkLight
-
PDF
This is a step-by-step tutorial for creating a PostgreSQL connection.
Prerequisites
You must first set up your database's Host, Port, Username, Password and Whitelist our IPs before connecting to PostgreSQL.
Connection Procedure
1.Choose your Connection Name.
2. Enter Host.
3. Fill in the Port Number.
4. Enter your Database name.
5. Input your Username and Password.
6. Use the Test Connection function to see if your connection is up to the task.
If the connection succeeded, you can now use this connection in Rivery.
Disconnect Handling
There are two approaches to dealing with database disconnects:
- Optimistic - The optimistic approach to dealing with stale / closed connections is to let SQLAlchemy handle disconnects as they happen, at which point all connections in the pool are invalidated, which means they're assumed to be stale and will be refreshed upon the next checkout.
In general, the pessimistic approach adds some overhead but provides a more stable connection, whereas the optimistic approach is faster but is recommended for databases that are less likely to be disconnected or restarted.
- Pessimistic - This approach entails issuing a test statement on the SQL connection at the beginning of each connection pool checkout to ensure that the database connection is still operational.
SSL Connection (Optional)
Some PostgreSQL hosts may require SSL certificate to validate and enable the connection.
It is possible to upload SSL certificate and also bypass hostname validation checks via the Allow Invalid Certificate/Hostnames options.
SSH Connection (Optional)
Using a hybrid method of data processing, Rivery can connect to on-prem servers. We recommend the use of an SSH Tunneling Method.
To use the SSH Tunneling via Rivery, please configure your SSH Tunnel server in your network. This server will have the ability to get SSH connections from Rivery IPs, and will
be able to connect to your database server via the internal IP or address. Rivery connects to that SSH server using a private key.
After you've configured SSH tunneling, you can set it up in the Rivery Connection: