From: | Nick Guenther <nguenthe(at)uwaterloo(dot)ca> |
---|---|
To: | lin <jluwln(at)163(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: change the value of "unix_socket_directories" , must used "-h /xx/xx" to use the Unix domain socket |
Date: | 2014-08-16 16:01:23 |
Message-ID: | 2f6b825a-9adc-4a14-b08d-7a8e09b8899e@email.android.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On August 16, 2014 11:41:02 AM EDT, lin <jluwln(at)163(dot)com> wrote:
>Hi all,
>I change the value of "unix_socket_directories" in postgresql.conf ,
>then restart the database, but it cannot connect the database used like
>this
>"psql -d postgres -p 5432" , it must given the parameter " -h /xx/xx"
>to use the Unix domain socket。
> how to fix this issue ?
I'll start by saying that your test case is very clear, and thank you for it. I am unsure what your goal is, however. I assume you are trying to set up parallel postgres processes, for debugging. I've done this recently, for that reason.
First thing to point out is that you need only one of -h and -p. They are redundant options, because you only connect to postgres either over TCP (-p) or with a unix domain socket (-h).
Second, what you're seeing is necessary. If you change the default, then psql doesn't know where to look. However, you can recover the old behaviour with shell tricks:
$ alias psql='psql -h /xx/xx'
$ psql -d postgres
(Personally, I wrote a short wrapper script called "client.sh" which depth-first searches for a postgres db directory and the runs 'psql -h' with the first one it finds; equally well you could have this script install an alias)
Are you perhaps confused about what a unix domain socket is? Why are you changing it? This is a decent description of it:
http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man4/unix.4
From | Date | Subject | |
---|---|---|---|
Next Message | John R Pierce | 2014-08-16 16:06:38 | Re: change the value of "unix_socket_directories" , must used "-h /xx/xx" to use the Unix domain socket |
Previous Message | Steve Atkins | 2014-08-16 15:56:13 | Re: change the value of "unix_socket_directories" , must used "-h /xx/xx" to use the Unix domain socket |