Thread: How to connect to a remote database

How to connect to a remote database

From
pgsql-bugs@postgresql.org
Date:
Martin Kuria (martinkuria@hotmail.com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
How to connect to a remote database

Long Description
This may be a dumb question, but how do I connect to a remote database
using postgresql, or rather psql?

I have  trouble connecting to the remote host, to access the database what command should use to connect to the
databasein remote host in the prompt, Thanks again. 

Thanks

Martin



Sample Code


No file was uploaded with this report

Re: How to connect to a remote database

From
Jerome Alet
Date:
Hi,

this is probably not a bug.

with psql you have to use the -h option

e.g.: psql -h mypgserver.mydomain [mydatabase]

and on mypgserver.mydomain computer you have to launch postgresql with
the -i option, telling it to listen for TCP/IP connections, and check
pg_hba.conf for possible restricitions.

bye,

Jerome ALET - alet@unice.fr - http://cortex.unice.fr/~jerome
Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30
28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE

On Thu, 7 Sep 2000 pgsql-bugs@postgresql.org wrote:

> Martin Kuria (martinkuria@hotmail.com) reports a bug with a severity of 2
> The lower the number the more severe it is.
>
> Short Description
> How to connect to a remote database
>
> Long Description
> This may be a dumb question, but how do I connect to a remote database
> using postgresql, or rather psql?
>
> I have  trouble connecting to the remote host, to access the database what command should use to connect to the
databasein remote host in the prompt, Thanks again. 
>
> Thanks
>
> Martin
>
>
>
> Sample Code
>
>
> No file was uploaded with this report
>

Re: How to connect to a remote database

From
"Vasileiadis Spyros"
Date:
USE:
psql -h <host> -p <port> -u <database>
psql -h <host> -p <port> -U <username> -W <password> <database>

read the man page

SV

----- Original Message -----
From: <pgsql-bugs@postgresql.org>
To: <pgsql-bugs@postgresql.org>
Sent: Thursday, September 07, 2000 2:21 PM
Subject: [BUGS] How to connect to a remote database


> Martin Kuria (martinkuria@hotmail.com) reports a bug with a severity of 2
> The lower the number the more severe it is.
>
> Short Description
> How to connect to a remote database
>
> Long Description
> This may be a dumb question, but how do I connect to a remote database
> using postgresql, or rather psql?
>
> I have  trouble connecting to the remote host, to access the database what
command should use to connect to the database in remote host in the prompt,
Thanks again.
>
> Thanks
>
> Martin
>
>
>
> Sample Code
>
>
> No file was uploaded with this report
>

Re: How to connect to a remote database

From
Sean Kelly
Date:
On Thu, 7 Sep 2000 07:21:57 -0400 (EDT), pgsql-bugs@postgresql.org
said:

> Martin Kuria (martinkuria@hotmail.com) reports a bug with a severity of 2
>  The lower the number the more severe it is.
>
>  Short Description
>  How to connect to a remote database
>
>  Long Description
>  This may be a dumb question, but how do I connect to a remote database
>  using postgresql, or rather psql?

    This isn't really a bug, is it? :)

    "man psql" shows your options - you need "-h hostname_here".
See "man psql" for more.

    You'll probably have to edit /path/to/pgsql/lib/pg_hba.conf
on the remote machine to get permission.

    Thanks,

--
Sean Kelly <S.Kelly@ncl.ac.uk>
"The best way to predict the future is to invent it" - Alan Kay