Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 12th, 2005, 12:43 AM
Szûcs Gábor
Guest
 
Posts: n/a
Default unix_socket_directory not fully recognized by pg_ctl?

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 majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

  #2  
Old November 12th, 2005, 12:44 AM
Oliver Elphick
Guest
 
Posts: n/a
Default Re: unix_socket_directory not fully recognized by pg_ctl?

On Sun, 2003-11-16 at 21:01, Szûcs Gábor wrote:[color=blue]
> 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.[/color]

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.
[color=blue]
> 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?[/color]

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.
[color=blue]
> Is this the only way to tell this to psql?[/color]

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.
[color=blue]
> Is there a compile-time configuration parameter? (could not find it)[/color]

#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql"
in src/include/pg_config_manual.h
[color=blue]
> Is there a psqlrc setting for this?[/color]

No - that is too late. You need the location of the socket before you
start the connection.
[color=blue]
> Is there a complete description for psqlrc? (could not find it)[/color]

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 Oliver.Elphick@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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles