Sunday 31 December 2023

 

After installation and configuration of the Postgres cluster. Let's see how we can connect to the PG database using the developer tool. In this section, we are going to see how we can connect to the PG database using Azure Data Studio. For this deployment, we already installed the Azure data studio in our local Windows system. you can download the Azure Data Studio from the Microsoft url it is free software.

Deployment diagram:



Infrastructure Details:

HOST NAME: PG_V16.example.com

Client Machine

Red Hat Enterprise Linux release 8.6 (Ootpa)

Azure Data Studio Version

1.47.0 (User Setup)

 

1] Already PG database 5432 port is already enabled on the database server so it will access the database remotely using the same port.

2] let's change the setting in postgresql.conf file

 

[root@PG-V16 data]# pwd

/var/lib/pgsql/16/data

[root@PG-V16 data]# cat postgresql.conf | grep -i listen

listen_addresses = '*'          # what IP address(es) to listen on;

[root@PG-V16 data]#

 

3] let's change the below parameter to a file pg_hba.conf. Specify the remote server IP/hostname address. If you know the network CDRS of remote users then you can add them so all users from the remote network can access the PG database

[root@PG-V16 data]# cat pg_hba.conf | grep -i host

# "host" records.  In that case you will also need to make PostgreSQL

host    all             all             127.0.0.1/32            scram-sha-256

host    all             all             ::1/128                 scram-sha-256

# Allow replication connections from localhost, by a user with the

host    replication     all             127.0.0.1/32            scram-sha-256

host    all             all             192.168.*.*/0           md5

host    replication     all             ::1/128                 scram-sha-256

 

3] let's try to connect the PG database using Azure Data Studio

 

Click on the connection and specify the database connection details.





No comments:

Post a Comment

work on autovacuum postgreSQL parameter

 In This blog, we are discussing the auto vacuum parameter on a small scale. we will understand the below parameters and will see how to mod...