Re: setting Postgres client

Поиск
Список
Период
Сортировка
От Markova, Nina
Тема Re: setting Postgres client
Дата
Msg-id 6D8C7E015447D0428D80E9DBABA06A1E04013ACC@S0-OTT-X2.nrn.nrcan.gc.ca
обсуждение исходный текст
Ответ на setting Postgres client  ("Markova, Nina" <nmarkova@NRCan.gc.ca>)
Ответы Re: setting Postgres client  (Steve Clark <sclark@netwolves.com>)
Re: setting Postgres client  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Thanks Richard.


I specified the host IP ( I use the default 5432 port), got error:
psql: could not connect to server: Connection refused
        Is the server running on host "192.168.XX.XXX" and accepting
        TCP/IP connections on port 5432?

The only tcp lines in my postgres.conf are
#tcp_keepalives_idle = 0                # TCP_KEEPIDLE, in seconds;
                                        # 0 selects the system default
#tcp_keepalives_interval = 0            # TCP_KEEPINTVL, in seconds;
                                        # 0 selects the system default
#tcp_keepalives_count = 0               # TCP_KEEPCNT;
                                        # 0 selects the system default
Should I change something here?

Nina

-----Original Message-----
From: Richard Huxton [mailto:dev@archonet.com]
Sent: September 19, 2008 10:15
To: Markova, Nina
Subject: Re: [GENERAL] setting Postgres client

Markova, Nina wrote:
> Now I need to set up a client in a non-global zone on the same machine

> or on anoter machine.
> Not much luck so far.
>
>
> What I did:
> ===========
> - on the server in $PGDATA/pg_hub.conf I added a line for the client
> host    all         all         192.XXX.XX.XXX        trust
>
> - On the client I tried:
> psql sta
> psql: could not connect to server: No such file or directory
>         Is the server running locally and accepting
>         connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
>
>
> In my understanding:
> - the data and the log file should exist on the server only.
> - I should have postgres configuration file somewhere on the client to

> at least specify Postgres server ip (PGHOSTTADDR and/or PGHOST), or
> this should be set different way?

You can provide a hostname on the command-line too "psql -h 192.168.1.2"
, in an environment variable or in a "connection service file". Without
that, it defaults to trying to connect by unix domain sockets (on unix)
which I'm guessing doesn't work because your server is in a different
zone. Try an explicit IP address, as above.

> Questions:
> ==========
> - where to find steps for setting up postgres client?

If it runs, it's set up.

> - what directories and files should I have on the client side?

none

> - should I have local log file on the client?

No. Well, you get a .psql_history file if you have readline enabled.

> - how to start postgres on the client - should I specify $PGDATA?

No

> - Should $PGDATA be shared, i.e. mounted by the client, or I have
> choice not to? I actually prefer not to be mounted.

No

> - I read that for the client side I should have only 2 of the packages

> - SUNWpostgr-libs and SUNWpostgr. All 24 packges for postgres are
> there - should I remove the rest?

Can't help sorry.

> - where to specify PGHOSTTADDR and/or PGHOST?

You can do it in your shell profile on a per-user basis, or for the
whole machine. I tend to do it no the command-line or in an shell alias
myself  though.

--
  Richard Huxton
  Archonet Ltd

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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: setting Postgres client
Следующее
От: Tom Lane
Дата:
Сообщение: Re: is not distinct from any(...)