Thread: Remote login to the database

Remote login to the database

From
"vijayendra mohan agrawal"
Date:
Hi,

Sorry if the question is too preliminary.

I want to know if we can login to the database running at the server from
any place. I know I have to allow such access thru pg_hba.conf file. But how
do I connect to the database.

Can I do something like :

pgsql database@serverIP where serverIP can be any valid IP address in the
LAN.

OR

pgsql database@connect_string where connect string is defined in some of the
configuration file.

Please revert back

Thanks and regards
Vijay



Re: Remote login to the database

From
Jared Sulem
Date:
vijayendra mohan agrawal wrote:

 > how do I connect to the database.

psql -h host [-p port] [-U username] database_name

OR

psql -h host [-p port] database_name username

psql --help for details of all the options.

One thing to remember - if you try to login from the database machine
and if you have restricted access to the database from localhost
(127.0.0.1) but not from the database machines network IP address, then
you must specify the host option with the local machines network IP address.

Jared