I am trying to configure my Postgres instance so that only the local machine and my machine (over internet) should be able to access the database. The postgresql.conf
file has parameter listen_addresses
which can be used to set the list of ip addresses to which access is granted.
So I set it as listen_addresses 'localhost,a.b.c.d'
which mean it will grant access to localhost
and a.b.c.d
which is, say my ip address. But in this case it just grant access to localhost.
listen_addresses 'a.b.c.d'
also does not work.
I double checked the internet ip address but it is correct.
I tried
listen_addresses 'localhost' // works only for local machine.
listen_addresses '*' // works for both local and my machine
listen_addresses 'localhost,a.b.c.d' // does not work for my machine
listen_addresses 'a.b.c.d' // does not work for my machine
So am I missing something here ?