Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYkS5-00049b-VE for pgsql-general@arkaria.postgresql.org; Thu, 15 Sep 2022 08:42:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oYkS4-0003Rw-Fb for pgsql-general@arkaria.postgresql.org; Thu, 15 Sep 2022 08:42:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYkS3-0003Rn-Dn for pgsql-general@lists.postgresql.org; Thu, 15 Sep 2022 08:42:27 +0000 Received: from mx0d-001a4c01.pphosted.com ([67.231.151.23] helo=mx0c-001a4c01.pphosted.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYkRz-0007pJ-EZ for pgsql-general@lists.postgresql.org; Thu, 15 Sep 2022 08:42:25 +0000 Received: from pps.filterd (m0075702.ppops.net [127.0.0.1]) by mx0d-001a4c01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28EISVbr003508; Thu, 15 Sep 2022 04:42:19 -0400 Authentication-Results: ppops.net; spf=fail smtp.mailfrom=sebastien.flaesch@4js.com; dkim=pass header.d=ourvolaris.onmicrosoft.com header.s=selector2-ourvolaris-onmicrosoft-com Received: from eur01-ve1-obe.outbound.protection.outlook.com (mail-ve1eur01lp2053.outbound.protection.outlook.com [104.47.1.53]) by mx0d-001a4c01.pphosted.com (PPS) with ESMTPS id 3jjxyn212k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Sep 2022 04:42:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KAS9zvKAZXh0HVj0FRUn3J84iSzXtXzU3HBncrpYC1CBykC+4AlYCscQof115x2To7tmZwHXSvrOT/wvw07+s98XgJyzPF+k/pNpqp8HxcE6GXevlsen5MsEHSdWMVVlUndn7Ns46d9DWa8hs2OpTi3Dh/TuJ/GTWS8KeGNcBXmFUJOdszeyzIK+ypYFm12867xealyGpq7xrmXgyGa18Ld2k4hc1Dqsunpc7onFTrsmdrEzKV2OB6Ih5dHZpYe7pIPyjPiU2nyeinePUWejAvKd5I20AQpLVv1ygt69q1LD5ZC1b7cYVGtUOKvpLuIKSQ7EYWO45+mkXs14wrOFFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BHzNH1SbwuK1GVxi8Uggde6U7mnGVC75RYv08RBDfeA=; b=M7gdoXdTOgsf7aAOMSip/JIkPo8v1hPw6KvErug5bFzR+OCz3jPeWp/brruUUb1kpkWUnMKJTn6CFcMyvRpTUOUBbVgXWGdHSf0nVTYg3fXgclJJ73ZvHH57MIRnrBGiJw8P6qknCL0d9pGfzvJbvdVAUIhmzuYYVpa8Tea4Oqo1E7ejaRH6WE5PJekg9eQ7khLgYj03qvujG4Qk3AFni8Hfz2eEGOBjIdGu4eQmD+ECCj4ZroEk8HPQdr8J9w/x8WKxs/Rs6IwS+rv6o4Hl250fNaPV/HeT85yvdHjtlAZm4FrGvNjQMuDY4+vDrq93+wrtJyeG3OUbuUgHcdQs7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=4js.com; dmarc=pass action=none header.from=4js.com; dkim=pass header.d=4js.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ourvolaris.onmicrosoft.com; s=selector2-ourvolaris-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BHzNH1SbwuK1GVxi8Uggde6U7mnGVC75RYv08RBDfeA=; b=FCPuqPogdUJdNT1sVbtVrRU6GkbpZsSheCJmhonE7Uzy3JV86TyyoB15e5DQfpA5gBz+NP8gm6FrEF8h7lRVmquQ0F+CpM5WQOHRnafCDD2QgosxGj07NaIJdEEWFmkh5BArKLpjqvzspY2IByyr9RGySrz73z7DkOf/qYm9UBM= Received: from DBAP191MB1289.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:1c9::19) by VE1P191MB1088.EURP191.PROD.OUTLOOK.COM (2603:10a6:800:16c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.15; Thu, 15 Sep 2022 08:42:16 +0000 Received: from DBAP191MB1289.EURP191.PROD.OUTLOOK.COM ([fe80::7404:56cd:1bf8:2406]) by DBAP191MB1289.EURP191.PROD.OUTLOOK.COM ([fe80::7404:56cd:1bf8:2406%5]) with mapi id 15.20.5612.022; Thu, 15 Sep 2022 08:42:15 +0000 From: Sebastien Flaesch To: Francisco Olarte CC: Tom Lane , "pgsql-general@lists.postgresql.org" Subject: Re: Resolving host to IP address Thread-Topic: Resolving host to IP address Thread-Index: AQHYxqBxHE/ckaU9dUmDcNFR8SB4s63b1cSAgAAB4YCAAAS4dIAAD6mAgAQvXHg= Date: Thu, 15 Sep 2022 08:42:15 +0000 Message-ID: References: <1611957.1662991871@sss.pgh.pa.us> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DBAP191MB1289:EE_|VE1P191MB1088:EE_ x-ms-office365-filtering-correlation-id: 53500f7f-cf8b-4ee6-5fb0-08da96f63145 x-volarisppoutbound: true x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: n0sOGEKT+yUU5Cmk3t4jzxc0oMBfaD/FeP06NKk3HdxRZMlmRoY1ePvqhmo1eR60RD9YOAwuzMeYcH3XTu+60RQlvtFqXcFbV7OyA6C4MM8uIIKI9LtI/309qEM3f1CZBFeZuDhKIZPh5mS9irUSPEey1327+jyvqLg404ZFXNHYXqV8ZrrMXVwUgZBf0nsBudTkzcK4g2hXZRwS7SMl+25jyf2Brw6WUpNtZ7s1rL35vmEWXdQ3F8WiCDJV53u6pwUo14MmlYBbOMZyHDYb6XntC54qOZWO2bvMBoWmR994toM3qBR+g6GCM+bV8byqnh+mtJv12yzxvTluUbc9yxFASR+Wj1lyhsS5IMwjzIWv6PiRZI0DZxNLS/yB5pyqBjC1OMaXZ77Qiyud+lP/reL7qpWIzfo07XsAwJWEWKPxBZ1MCV+9nXAQI5rRK+O5zUdMBKJUK5tfUCul8TQvbqnhgdKYWwrsNa3ADQRql3Z4vlAfy+sfy8Hpy/APFsDWEbotgJ1yk2jr7AFjYbwDZqAZ7C3AR37optKORQdd/GUL/qQvjz3MuI0i9hJfRhGgc4/BWR+ElzzT+u406ScFUDm8QvlT3qM2sWesdV01qNWctQAXo2Cqw7fByTSHRTOXpqhYuXQEhKzYk9IfDtSj2DrPmdF9U3VYY4KKxwVRpTy8wedptDSVYo+38wO6Q3h6cH9EqjG5WoG5UD++tmBFIEtDC49JsdJCK8LxqGG9GVRn3xJVIGNXptHlo4Jchht2UM0sTguCktRvOQQuI5efRZelXkNqvWEzczZpahvLx2g= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBAP191MB1289.EURP191.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(396003)(366004)(39860400002)(136003)(376002)(451199015)(86362001)(38070700005)(33656002)(122000001)(38100700002)(8676002)(66556008)(64756008)(76116006)(66946007)(52536014)(4326008)(66446008)(54906003)(66476007)(6916009)(316002)(8936002)(55016003)(91956017)(44832011)(5660300002)(2906002)(186003)(478600001)(83380400001)(71200400001)(53546011)(7696005)(6506007)(9686003)(26005)(41300700001)(19627405001)(21314003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UwHw4cAKWBJX8UyAeu74Lgpi50GZK8k3eS9UyN76IOopjsrdLmorAltaa+Ju?= =?us-ascii?Q?2xVJZnOm4RTICslfKL/kRZ8VgzFA9Fi1kHLuFK42Jsd9SqFgmOjWng7EVAQG?= =?us-ascii?Q?mfrXR+eoRSPppEDyMmb3OKQGa3bItRJ3OGrh0W9BqdUJpaNJN7zHYFwkHSCQ?= =?us-ascii?Q?U05t1/UdQIKTbx1LhXlM4KXpLg0k1vbtHXaVtkWom+OifLvmVUGtxS2L0ajA?= =?us-ascii?Q?6XA/V/ferGFipyMNBXOzJQBak62ZRO4MNvfNpQwle2IIMNZWqDBX/6wmk1OB?= =?us-ascii?Q?L98PDpWbcJ3cmyeGHoU/iOCKNKeEPIpoe8gP9fm5rn6+uPOdEWy3XX56/NZR?= =?us-ascii?Q?ISRAgjHCT470UinosKEwXh2I9A6KUkFlD0R+fLgP903wWBGiuaN0IfhABKEY?= =?us-ascii?Q?iY09RQrqm58NUt10fv/SWQOgleQKslf+R11u5v856pVdt83F1JcR9zss5h58?= =?us-ascii?Q?RsYj/mFrQuoEqxdFyDFj8I78m1cMHyOH9zGjwe8DSngJVzzDRd2qmJl5V71V?= =?us-ascii?Q?sGrZ6RCeApj8YNCa1+Q2u0qBsip5UzXj5hqqH0vja6d/hCw4t3tT1/Z38dDE?= =?us-ascii?Q?zLzWOwSa38Yd6OnhkEvS+j+fDNjZMCxhfgtXzmgdyk+3Ifd96ok4+suFi0gA?= =?us-ascii?Q?YvBw3YPaEB5UtvN6RX8bpN3N9VMZMNK/wi56Smf9VzUGjkp/Jg3iAzGuu9gp?= =?us-ascii?Q?VasPmhy3I9R04/8RRa6yRdLHPnGH85PuI9McLJ+T2wisV3Jw4g8EH3M9hkku?= =?us-ascii?Q?KsipBXveyGbk3HXVdkgmvd/F70Sczx/C8D6zkTDMMIO9jVvh+KzmXXpyR++t?= =?us-ascii?Q?LC0CzKNqOEr/hMN4yYcITsVI8uPvb2zcmEiUGc0N+u9s0rLpyOjrO9FNrZDp?= =?us-ascii?Q?gtAkuzWdCN60lGc4il1DTpfh36H2t27z5xAqVgGj9jBK2WDCNwOqt8hfvN6/?= =?us-ascii?Q?GutTwps4ePF/I8a+DbveaHzv2jmen6VduPvWwPD8bGS1kUK4om1aTuGbDakQ?= =?us-ascii?Q?WuSuxRPWYjFe4vuMxkaFn61rJJZXXqwFohscXxlrBHlrIfvsp6gu92Yp+Upa?= =?us-ascii?Q?3s7MBXfBtPVBy9I/ZZrejBQJIJRCLFC1NCgoXfz5+/wYbROALK77FaCVsBFL?= =?us-ascii?Q?h71FoWRbLA+Wb0GHikJwaZfhhadnMRZJYjy4TWi5EqXWgjMU5F6JjUh0rwq3?= =?us-ascii?Q?JhrrhjYfUrpR44QT5w7BOaXvDRfxIxNQOe0iPnOH5b4hlr4BAgI+MzmflhkT?= =?us-ascii?Q?0jGQzl2z7NAzak63zl4SAPt1PjZoGCSJjmJZ7uA1gmse90MCQYL/vxlVYqEl?= =?us-ascii?Q?plqFpzPbz2PAbfz4/8clvcg0/WlxYFEN4RwF7XqUuBzkyu3tYYd99d+jn7+1?= =?us-ascii?Q?WOdZun8c3s9eprDV1FZIoHFPQufsKwDTcyfwjM0n/KqliIYgaLykfAsa6RZV?= =?us-ascii?Q?e3s8LsiaFcOU/mgrlPDyTpMyXhdY6rzaQ0E5bjo0NlN52Me7gvV/zv+cHPUs?= =?us-ascii?Q?WW9L2YBwi6QK4HzyevbZl4zFRdKgu0uWB+81/h0W3a9T9kZQiIjfTezXnRFR?= =?us-ascii?Q?Pkq4hloSK+o7EEkKYk+L8fzGz/QItutDhSPHy92a?= Content-Type: multipart/alternative; boundary="_000_DBAP191MB128975A247468928426C6367B0499DBAP191MB1289EURP_" MIME-Version: 1.0 X-OriginatorOrg: 4js.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DBAP191MB1289.EURP191.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 53500f7f-cf8b-4ee6-5fb0-08da96f63145 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Sep 2022 08:42:15.8941 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 75c696ec-5bfb-4892-9a0c-9187a9061cd6 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: J9JQUnXQPDE2YTvQnBBN0LmJEzHZJXyyJsICCDA/Gn0LT9T4eLt/CmE1v73eXN82DCY/8j3jp1Jz4PdQjsD8pynJ2yYSh0OYMFJ5e717pZo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1P191MB1088 X-Proofpoint-ORIG-GUID: vqiqdObQjfbDkH2CVECsmlbKauC8qSNN X-Proofpoint-GUID: vqiqdObQjfbDkH2CVECsmlbKauC8qSNN X-ProofpointHeader: Yes X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 phishscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2208220000 definitions=main-2209150047 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_DBAP191MB128975A247468928426C6367B0499DBAP191MB1289EURP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi! That works for my case now: postgresql.conf: listen_addresses =3D '0.0.0.0' (only IPv4 is ok for me) pg_hba.conf: hostssl all pgsuser samenet md5 client= cert=3Dverify-ca In /etc/hosts, I still have: 127.0.1.1 toro.strasbourg.4js.com toro But that could go away if I understand well, as long as toro[.stras...] hos= t names can be resolved. Note: I did not need to re-create the certificates. Thanks a lot, Seb ________________________________ From: Francisco Olarte Sent: Monday, September 12, 2022 5:30 PM To: Sebastien Flaesch Cc: Tom Lane ; pgsql-general@lists.postgresql.org Subject: Re: Resolving host to IP address EXTERNAL: Do not click links or open attachments if you do not recognize th= e sender. Hi Sebastien: On Mon, 12 Sept 2022 at 16:40, Sebastien Flaesch wrote: > I think I got it: PostgreSQL should listen to the real, non-loopback netw= ork interface. Not really. Your problem is not where postgres listens, but where your host line resolves, the 127.0.1.1 stuff, plus your rules. In many OS you can bind a listening TCP socket to IN_ADDR_ANY plus a port. The good thing of doing it is it will work even if you add / delete new IP addresses. Postgres does this and, IMO, is a good thing. You seem to have it configured that way----- > Just for info (local dev config, not prod): > sf@toro:/opt3/dbs/pgs/14.1-openssl/data$ grep listen_addresses postgresql= .conf > listen_addresses =3D 'localhost,toro.strasbourg.4js.com' No, you do not, you list your interfaces...... Unless you have a complex setup, which does not seem to be the case, I would recommend just using the default "*", specially if you intend to run your servers firewalled ( which 10.xxx hints to ). This would lead to something like .. tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN tcp6 0 0 :::5432 :::* LISTEN ( not done with pg, done with nc -l, but it worked the same last time I checked it ) > sf@toro:/opt3/dbs/pgs/14.1-openssl/data$ netstat -tl -W | grep 5437 > tcp 0 0 localhost:5437 0.0.0.0:* LISTE= N > tcp 0 0 toro.strasbourg.4js.com:5437 0.0.0.0:* = LISTEN > tcp6 0 0 localhost:5437 [::]:* LISTE= N There is a piece of info missing here, where does your localhost resolve to= ..... > sf@toro:/opt3/dbs/pgs/14.1-openssl/data$ netstat -tl -W --numeric-hosts |= grep 5437 > tcp 0 0 127.0.0.1:5437 0.0.0.0:* LISTE= N > tcp 0 0 127.0.1.1:5437 0.0.0.0:* LISTE= N > tcp6 0 0 ::1:5437 :::* LISTE= N But from this it seems, if you have restored the 127.0.1.1 hosts line, to 127.0.0.1+::1 > sf@toro:/opt3/dbs/pgs/14.1-openssl/data$ ip route get 127.0.1.1 > local 127.0.1.1 dev lo src 127.0.0.1 uid 1000 > cache This is expected. IMO your problem arises from your pg_hba.conf, and your bizarre ( IMO, I use debian too and one of the first things I do after installing is dropping the 127.0.1.1 line, but I used fixed IP on a desktop, so YMMV ). If you just lists localhost as origin ( which means you have to duplicate the pg_hba.conf lines, listen_address=3D* will work for both ) it will work right, whatever your listen_adresses is ). You can also RTFM a bit and notice the line "You can also write all to match any IP address, samehost to match any of the server's own IP addresses, or samenet to match any address in any subnet that the server is directly connected to." ( it is easy to miss, I had to search for it, even if I knew it existed ). Note: localhost is a name, like toro, and is resolved, samehost/samenet/all are magic. Sumarizing, I would: - Use listen_adresses=3D* - Use samehost in your rules. Which will lead to a lean config which probably does what you want. Francisco Olarte. --_000_DBAP191MB128975A247468928426C6367B0499DBAP191MB1289EURP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi!

That works for my case now:

postgresql.conf:

listen_addresses =3D '0.0.0.0'    (only IPv4 is ok for me)

pg_hba.conf:

hostssl all             pgsuser    =     samenet                  md5 client= cert=3Dverify-ca


In /etc/hosts, I still have:

127.0.1.1       toro.strasbourg.4js.com toro

But that could go away if I understand well, as long as toro[.stras...] hos= t names can be resolved.


Note: I did not need to re-create the certificates.

Thanks a lot,
Seb

From: Francisco Olarte <= folarte@peoplecall.com>
Sent: Monday, September 12, 2022 5:30 PM
To: Sebastien Flaesch <sebastien.flaesch@4js.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general@lists.postgres= ql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Resolving host to IP address
 
EXTERNAL: Do not click links or open attachments i= f you do not recognize the sender.

Hi  Sebastien:

On Mon, 12 Sept 2022 at 16:40, Sebastien Flaesch
<sebastien.flaesch@4js.com> wrote:

> I think I got it: PostgreSQL should listen to the real, non-loopback n= etwork interface.

Not really. Your problem is not where postgres listens, but where your
host line resolves, the 127.0.1.1 stuff, plus your rules.

In many OS you can bind a listening TCP socket to IN_ADDR_ANY plus a
port. The good thing of doing it is it will work even if you add /
delete new IP addresses. Postgres does this and, IMO, is a good thing.
You seem to have it configured that way-----

> Just for info (local dev config, not prod):
> sf@toro:/opt3/dbs/pgs/14.1-openssl/data$ grep listen_addresses postgre= sql.conf
> listen_addresses =3D 'localhost,toro.strasbourg.4js.com'

No, you do not, you list your interfaces...... Unless you have a
complex setup, which does not seem to be the case, I would recommend
just using the default "*", specially if you intend to run your servers firewalled ( which 10.xxx hints to ). This would lead to
something like ..

tcp        0    &nbs= p; 0 0.0.0.0:5432         &nbs= p;  0.0.0.0:*         &nb= sp;     LISTEN
tcp6       0      0 = :::5432           &n= bsp;     :::*       =              LI= STEN

( not done with pg, done with nc -l, but it worked the same last time
I checked it )

> sf@toro:/opt3/dbs/pgs/14.1-openssl/data$ netstat -tl -W | grep 5437 > tcp        0    = ;  0 localhost:5437        &nb= sp; 0.0.0.0:*          &n= bsp;    LISTEN
> tcp        0    = ;  0 toro.strasbourg.4js.com:5437 0.0.0.0:*    &nb= sp;          LISTEN
> tcp6       0    &nbs= p; 0 localhost:5437          [= ::]:*           &nbs= p;      LISTEN

There is a piece of info missing here, where does your localhost resolve to= .....

> sf@toro:/opt3/dbs/pgs/14.1-openssl/data$ netstat -tl -W --numeric-host= s | grep 5437
> tcp        0    = ;  0 127.0.0.1:5437        &nb= sp; 0.0.0.0:*          &n= bsp;    LISTEN
> tcp        0    = ;  0 127.0.1.1:5437        &nb= sp; 0.0.0.0:*          &n= bsp;    LISTEN
> tcp6       0    &nbs= p; 0 ::1:5437          &n= bsp;     :::*       =              LI= STEN

But from this it seems, if you have restored the 127.0.1.1 hosts line,
to 127.0.0.1+::1

> sf@toro:/opt3/dbs/pgs/14.1-openssl/data$ ip route get 127.0.1.1
> local 127.0.1.1 dev lo src 127.0.0.1 uid 1000
>     cache <local>
This is expected.

IMO your problem arises from your pg_hba.conf, and your bizarre ( IMO,
I use debian too and one of the first things I do after installing is
dropping the 127.0.1.1 line, but I used fixed IP on a desktop, so YMMV
).
If you just lists localhost as origin ( which means you have to
duplicate the pg_hba.conf lines, listen_address=3D* will work for both ) it will work right, whatever your listen_adresses is ). You can also
RTFM a bit and notice the line "You can also write all to match any IP=
address, samehost to match any of the server's own IP addresses, or
samenet to match any address in any subnet that the server is directly
connected to." ( it is easy to miss, I had to search for it, even if I=
knew it existed ).

Note: localhost is a name, like toro, and is resolved,
samehost/samenet/all are magic.


Sumarizing, I would:

- Use listen_adresses=3D*
- Use samehost in your rules.

Which will lead to a lean config which probably does what you want.

Francisco Olarte.
--_000_DBAP191MB128975A247468928426C6367B0499DBAP191MB1289EURP_--