OCI Database with PostgreSQL database system endpoints aren't directly accessible from the internet. Applications that need to connect to the database require connectivity to the VCN and private subnet of the database system.
Use one of the following methods to connect to a database in OCI Database with PostgreSQL for data management tasks:
Using site-to-site VPN between your on-premises network and the VCN of the database system. For more information, see Site-to-Site VPN.
Using a Bastion Port Forwarding Session
If you're connecting to the database using a Bastion port forwarding session, you can connect directly from a local network to the database. You don't need to configure a Compute instance to connect from.
Bastion sessions aren't permanently available. SSH port forwarding sessions use only one IP address at a time, and require a new session for each private IP address. For more information, see Session Types.
You can use Bastion to securely connect to a database for data management tasks. A bastion exists in the public subnet of the same VCN that contains the database system. Bastions establish the network infrastructure needed to connect a user to a target resource in the private subnet, such as a database system.
On a local machine, install a version of the PostgreSQL client that's compatible with the PostgreSQL version of the database system by following the instructions at https://www.postgresql.org/download/.
Connecting to the Database 🔗
Sign in to the database using the PostgreSQL client installed on a local machine.
Open the navigation menu and select Databases. Under PostgreSQL, select DB Systems.
(Optional)
In the List scope section, under Compartment, select a compartment.
Click the name of the database system.
On the database system details page, note the FQDN under Connection details.
Download the CA certificate from the Connection details section and save it to the following location: <parent_directory>/<dbsystem.pub>