PostgreSQL Configuration Tips [Database]


This article shows some tips for PostgreSQL.

🗻 Configure external connection to PostgreSQL process

Edit postgresql.conf:

listen_addresses = 'IP address to allow connection'

If you allow to connect all client, please set listen_addresses = '*''.

Edit pg_hba.conf:

# IPv4 local connections:
host all all 10.198.0.1/32 md5 # Allow only 10.198.0.1
host all all 10.198.0.0/24 md5 # Allow 10.198.0.0 - 10.198.0.255

After then please restart PostgreSQL process on your server.

# CentOS
systemctl restart postgresql.service
# systemctl restart postgresql-10.service

🍣 References

🖥 Recommended VPS Service

VULTR provides high performance cloud compute environment for you. Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour). In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!