From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Marco Craveiro <marco(dot)craveiro(at)gmail(dot)com> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Understanding the behaviour of hostname in psql |
Date: | 2010-12-04 21:52:49 |
Message-ID: | 12441.1291499569@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Marco Craveiro <marco(dot)craveiro(at)gmail(dot)com> writes:
> i'm looking for some help in understanding the behaviour of hostname
> in postgres 8.4. apologies if this has been asked before; i googled
> but to no avail.
> basically: do i need to supply both the 127.0.1.1 ip address in
> pg_hba.conf as well as the actual ip address (say 192.168.0.5) in
> order to be able
> to always have trusted local connections? and if yes, whats the best
> way of dealing with DHCP?
Well, a connection to "localhost" will generally go to 127.0.0.1
(*not* 127.0.1.1 --- that's just a typo from some hand hacking
of your hosts file, I bet). A connection to your host name will
go to whatever the assigned "real" IP is (192.168.0.5 in your
example). If you don't have a stable assigned IP because you're
using DHCP, the best advice would be to always write localhost
and never bohr in your psql -h switch.
This has nothing much to do with Postgres specifically --- it's a
generic property of hostname lookup.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Marco Craveiro | 2010-12-05 12:12:51 | Re: Understanding the behaviour of hostname in psql |
Previous Message | Marco Craveiro | 2010-12-04 20:57:19 | Understanding the behaviour of hostname in psql |