Re: psql -h host ...

From: louis gonzales <gonzales(at)linuxlouis(dot)net>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: James <hslee911(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: psql -h host ...
Date: 2006-06-27 15:42:51
Message-ID: 44A151FB.5060200@linuxlouis.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

James,
the "psql" command as you know is just the command line program that
requests connection to a database and depending how you issue the
command, determines if it's attempting to connect to a local file, or
via a network protocol (commonly TCP/IP). When you issue the command
from a remote host, relative to where the database is located, once the
database server receives the connection request, that request is looked
up in the pg_hba.conf file to validate the user attempting the request.

If the user meets the constraints imposed within, the user is granted
access to the database, otherwise, "try again."

If you launch the psql command directly on the server to connect locally
to the database, in this scenario, the server is 'the client' and
therefore would be looking up pg_hba.conf on 'the client' but this case
is no different from the remote client to the server, in that there are
still both roles being fulfilled and ultimately 'the server' is looking
up the request in the pg_hba.conf.

Hope this helps.

Martijn van Oosterhout wrote:

>On Mon, Jun 26, 2006 at 01:51:24PM -0700, James wrote:
>
>
>>In this command
>>psql -h host ...
>>
>>does it look for pg_hba.conf in the client or in the server?
>>
>>
>
>The server. Client machines do not necessarily have a pg_hba.conf and
>even if they do, clients are unlikely to be able to read it.
>
>Have a nice day,
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2006-06-27 15:45:17 Re: RAID + PostgreSQL?
Previous Message surabhi.ahuja 2006-06-27 15:19:46 Re: planning to upgrade to 8.1