Re: [JDBC] Questions on use - Mailing list pgsql-jdbc

From John R Pierce
Subject Re: [JDBC] Questions on use
Date
Msg-id 9b5bf55a-85be-e6b0-71d1-6579ea76891e@hogranch.com
Whole thread Raw
In response to Re: [JDBC] Questions on use  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: [JDBC] Questions on use  (Rich Shepard <rshepard@appl-ecosys.com>)
Re: Questions on use  (Rich Shepard <rshepard@appl-ecosys.com>)
List pgsql-jdbc
On 12/28/2016 10:41 AM, Rich Shepard wrote:
>   There's no problem from the command line,
>
> $ psql -h localhost emapw
> psql (9.6.1)
> Type "help" for help.
>
> emapw=#
>
> even without specifying the host.

with psql, no -h  and -h localhost are two different connection types.
if you don't specify a -h, it uses a 'unix domain socket', this uses the
pg_hba.conf lines that start with `local`...   if you DO specify -h
localhost, it uses a tcp/ip socket to localhost (typically 127.0.0.1 or
::1), these match the pg_hba.conf lines that start with `host` and
encompass one or the other of those networks.   note that even if your
system isn't using ipv6 for its network connections, it very well could
be using the ipv6 localhost ::1 (shorthand for
0000:0000:0000:0000:0000:0000:0000:0001)...


--
john r pierce, recycling bits in santa cruz



pgsql-jdbc by date:

Previous
From: Rich Shepard
Date:
Subject: Re: [JDBC] Questions on use
Next
From: Rich Shepard
Date:
Subject: Re: Questions on use