Sample Header Ad - 728x90

Howto disable Postgres listening on TCP?

7 votes
2 answers
12895 views
Simply to avoid many problems in the first place I do not want my postgres server program to accept/listen to anything from any network (i.e. TCP/IP 4/6) connections. My setup is a *Postgres 9.1* on an *Ubuntu 12.04* box and I thought tweeking /etc/postgresql/9.1/main/pg_hba.conf to not include those lines which commented out (see below) would cause postgres to "please not listen on network TCP/IP devices"
local   all             postgres        trust

# TYPE  DATABASE        USER            ADDRESS                 METHOD
# "local" is for Unix domain socket connections only
#local   all             all                                     md5
# IPv4 local connections:
#host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
#host    all             all             ::1/128                 md5

Also I know that there is the -i command line to start the postgres server with if we YES want to listen on TCP/IP . I actually seek for the opposite thing a -??? meaning NO please do NOT listen on TCP/IP. I used a netstat -utap | grep post and it shows that postgres besides my settings in /etc/postgresql/9.1/main/pg_hba.conf is still listening on TCP/IP. ## QUESTION ## What did I do wrong here? How can I shut off this TCP/IP listening attitude of my Postgres server? Having only unix socket listening I am happy to the max ;) Thank you Addition: I also perceive that postgres establishes a **UDP** connection to this 127.0.0.1:38860, what would this be about?
Asked by humanityANDpeace (383 rep)
Oct 28, 2013, 07:30 AM
Last activity: Mar 10, 2022, 10:50 PM