As some of you know, OpenBSD 3.3 chroots apache. So I'm running the 
postmaster with its socket in /var/www/tmp. However, psql doesn't allow 
me to specify a socket to point at:

Connection options:
   -h HOSTNAME     specify database server host (default: local socket)
   -p PORT         specify database server port (default: 5432)
   -U NAME         specify database user name (default: alex)
   -W              prompt for password (should happen automatically)

Could this be included in the next version?

Thanks,
alex


Sun, 11 May 2003 13:16:45 -0400
alex avriette <alex@posixnap.net>
psql inability to select a socket
alex avriette <alex@posixnap.net> writes:

> As some of you know, OpenBSD 3.3 chroots apache. So I'm running the
> postmaster with its socket in /var/www/tmp. However, psql doesn't
> allow me to specify a socket to point at:
> 
> Connection options:
>    -h HOSTNAME     specify database server host (default: local socket)
>    -p PORT         specify database server port (default: 5432)
>    -U NAME         specify database user name (default: alex)
>    -W              prompt for password (should happen automatically)
> 
> Could this be included in the next version?

See the 'unix_socket_directory' setting in postgresql.conf.

-Doug


11 May 2003 13:25:50 -0400
Doug McNaught <doug@mcnaught.org>
Re: psql inability to select a socket
On Sun, May 11, 2003 at 01:16:45PM -0400, alex avriette wrote:
> As some of you know, OpenBSD 3.3 chroots apache. So I'm running the 
> postmaster with its socket in /var/www/tmp. However, psql doesn't allow 
> me to specify a socket to point at:
> 
> Connection options:
>   -h HOSTNAME     specify database server host (default: local socket)

AFAIK there's a special case for "hostnames" with slashes; those get
interpreted as a path to a local socket.  Try setting PGHOST to 
/var/www/tmp before you start psql, for instance.


Jeroen


Sun, 11 May 2003 19:27:52 +0200
"Jeroen T. Vermeulen" <jtv@xs4all.nl>
Re: psql inability to select a socket

> AFAIK there's a special case for "hostnames" with slashes; those get
> interpreted as a path to a local socket.  Try setting PGHOST to
> /var/www/tmp before you start psql, for instance.

Ah! Jeroen this is wonderful. Thank you.

stink# setenv PGHOST /var/www/tmp
stink# /var/postgresql/bin/psql -U snort snort
Welcome to psql 7.3.2, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
        \h for help with SQL commands
        \? for help on internal slash commands
        \g or terminate with semicolon to execute query
        \q to quit

snort=>

My mistake, I didn't RT the FM:

        --host hostname
               Specifies the host name of the machine on which the
               postmaster is running. If host begins with a slash,
               it  is  used  as  the directory for the Unix-domain
               socket.

Would it be overly verbose to mention the various PGHOST, PGDATA, 
PGUSER, etc variables in the output of
`psql --help`?

Alex


Sun, 11 May 2003 15:13:11 -0400
alex avriette <alex@posixnap.net>
Re: psql inability to select a socket