Re: Postgres V9.1 - unix socket directory Ubuntu /tmp vs /var/run/postgres

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Day, David" <dday(at)redcom(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Postgres V9.1 - unix socket directory Ubuntu /tmp vs /var/run/postgres
Date: 2012-01-13 23:15:07
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

"Day, David" <dday(at)redcom(dot)com> writes:
> I have been working with a V9.0.5 postgresql source distribution under Ubuntu 10.04 where the tools (createdb, psql ) seemed to know that the socket communication file was found/created in /tmp.
> I don't recall having to set any configure options to have this work correctly.

> Upon recent migration to V9.1.2 I find that on using pg_ctl to start the database the socket file is created in /tmp. However the tools ( psql, creatdb ) seem to expect the socket file in /var/run/postgresql.

> I have solved my problem by declaring the unix_socket_directory in postgresql.conf file to be /var/run/postgresql. It does seem for a standard build they should have a common location?

If you build from unmodified PG sources, the default socket location is
indeed /tmp. However, Debian and related distros feel that this
violates some distro standard or other, so they modify the source code
to make the default location /var/run/postgresql. So it depends on
whose build you're using.

No, this state of affairs isn't tremendously satisfactory. But it's
unlikely to change. I suggest making sure that your psql etc come from
the same build as the server you're using.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message René Romero Benavides 2012-01-14 15:26:19 Re: large XML data type appears empty when doing a select
Previous Message Day, David 2012-01-13 22:06:26 Postgres V9.1 - unix socket directory Ubuntu /tmp vs /var/run/postgres