By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,933 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,933 IT Pros & Developers. It's quick & easy.

unix_socket_directory not fully recognized by pg_ctl?

P: n/a
Dear Gurus,

I have a similar problem as discussed in
http://archives.postgresql.org/pgsql...6/msg00321.php

This probably should go to pgsql-novice too, but I'm not a member of that
list so please forgive my lazyness.

I use Debian Woody Linux and installed postgres (v7.2.1), but I needed a
newer version, so decided to try 7.4RC2 (which is not in the news yet, as I
checked today). It compiled and installed, and I could run the backend.
However, PHP could not run, since it searched for the socket in
/var/run/postgresql.

I found the unix_socket_directory option in postgresql.conf and set it to
/var/run/postgresql and restarted the server with

bin/pg_ctl start -w -D data -l data/postgres.log

The socket file and socket lockfile was created in /var/run/postgresql
-- it's ok, but pg_ctl hung, and after quite some time it exited with
"pg_ctl: postmaster does not start"

However; I can connect the server with PHP's pg_connect(), or psql -- but
psql only works through TCP/IP (i.e. -h localhost). If run locally, it
searches for socket in /tmp. Using

psql -h /var/run/postgresql

did work. My questions are:
What causes pg_ctl's strange behaviour?
Is this the only way to tell this to psql?
Is there a compile-time configuration parameter? (could not find it)
Is there a psqlrc setting for this?
Is there a complete description for psqlrc? (could not find it)

TIA,

--------------------- cut here ---------------------

G.
--
while (!asleep) sheep++;
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Sun, 2003-11-16 at 21:01, Szûcs Gábor wrote:
Dear Gurus,

I have a similar problem as discussed in
http://archives.postgresql.org/pgsql...6/msg00321.php

This probably should go to pgsql-novice too, but I'm not a member of that
list so please forgive my lazyness.

I use Debian Woody Linux and installed postgres (v7.2.1), but I needed a
newer version, so decided to try 7.4RC2 (which is not in the news yet, asI
checked today). It compiled and installed, and I could run the backend.
However, PHP could not run, since it searched for the socket in
/var/run/postgresql.
The debian packages put the socket in /var/run/postgresql and therefore
everything that links to libpq.so on Debian will look for it there.
I found the unix_socket_directory option in postgresql.conf and set it to
/var/run/postgresql and restarted the server with

bin/pg_ctl start -w -D data -l data/postgres.log

The socket file and socket lockfile was created in /var/run/postgresql
-- it's ok, but pg_ctl hung, and after quite some time it exited with
"pg_ctl: postmaster does not start"

However; I can connect the server with PHP's pg_connect(), or psql -- but
psql only works through TCP/IP (i.e. -h localhost). If run locally, it
searches for socket in /tmp. Using

psql -h /var/run/postgresql

did work. My questions are:
What causes pg_ctl's strange behaviour?
That's the way it is built by default. Since you built it rather than
installing it from a package, that's the behaviour you got.
Is this the only way to tell this to psql?
You can say "psql -h /var/run/postgresql" to specify where the Unix
socket is. If the hostname begins with a slash, it is taken as the
socket location rather than a network address.
Is there a compile-time configuration parameter? (could not find it)
#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
in src/include/pg_config_manual.h
Is there a psqlrc setting for this?
No - that is too late. You need the location of the socket before you
start the connection.
Is there a complete description for psqlrc? (could not find it)


In the man page for psql. It contains commands (that would be valid on
the command line) to run as psql starts up.
You can get Debian packages of 7.4 built for woody from
http://people.debian.org/~elphick/debian

This will fix the incompatibilty problems you are having.

In /etc/apt/sources.list:
deb http://people.debian.org/~elphick/debian stable main

--
Oliver Elphick Ol************@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"A Song for the sabbath day. It is a good thing to
give thanks unto the LORD, and to sing praises unto
thy name, O most High." Psalms 92:1
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.