Re: setting Postgres client - Mailing list pgsql-general

From Steve Clark
Subject Re: setting Postgres client
Date
Msg-id 48D3C0E1.8050900@netwolves.com
Whole thread Raw
In response to Re: setting Postgres client  ("Markova, Nina" <nmarkova@NRCan.gc.ca>)
List pgsql-general
Markova, Nina wrote:
>
> 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
>   Archonport = 5432 et Ltd
>

port = 5432

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: is not distinct from any(...)
Next
From: Richard Huxton
Date:
Subject: Re: setting Postgres client