Re: pg_ctl with unix domain socket?

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: pg_ctl with unix domain socket?
Дата
Msg-id 200909010634.22466.aklaver@comcast.net
обсуждение исходный текст
Ответ на pg_ctl with unix domain socket?  (Josef Wolf <jw@raven.inka.de>)
Ответы Re: pg_ctl with unix domain socket?  (Josef Wolf <jw@raven.inka.de>)
Список pgsql-general
On Tuesday 01 September 2009 4:28:22 am Josef Wolf wrote:
> Hello,
>
> I have created a fresh cluster with
>
>    initdb -D /some/path/pgtest
>
> I can start postgres to run on unix domain socket serving this cluster
> with:
>
>    postgres -D /some/path/pgtest -h '' -k /some/path/pgtest
>
> But I'd like to use pg_ctl instead, in order to have clean control:
>
>    PGPORT=/some/path/pgtest pg_ctl -D/some/path/pgtest -l postgreslog start
>
>
> Any hints how to use pg_ctl to start/stop postgresql on a unix domain
> socket?

1) In postgresql.conf make listen_addresses empty per instructions:

http://www.postgresql.org/docs/8.4/interactive/runtime-config-connection.html#GUC-LISTEN-ADDRESSES
listen_addresses (string)

    Specifies the TCP/IP address(es) on which the server is to listen for
connections from client applications. The value takes the form of a
comma-separated list of host names and/or numeric IP addresses. The special
entry * corresponds to all available IP interfaces. If the list is empty, the
server does not listen on any IP interface at all, in which case only
Unix-domain sockets can be used to connect to it. The default value is
localhost, which allows only local "loopback" connections to be made. This
parameter can only be set at server start.

2) Use the -o switch to pass commands to postgres. See below:

http://www.postgresql.org/docs/8.4/interactive/app-pg-ctl.html
-o options

    Specifies options to be passed directly to the postgres command.

    The options are usually surrounded by single or double quotes to ensure that
they are passed through as a group.

--
Adrian Klaver
aklaver@comcast.net

В списке pgsql-general по дате отправления:

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: pg_ctl with unix domain socket?
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: Keys and indexes