Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tHqgR-00AFT4-9o for pgsql-general@arkaria.postgresql.org; Sun, 01 Dec 2024 20:36:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tHqgN-00AREf-RA for pgsql-general@arkaria.postgresql.org; Sun, 01 Dec 2024 20:36:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tHqgN-00AREX-Fd for pgsql-general@lists.postgresql.org; Sun, 01 Dec 2024 20:36:44 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tHqgL-000XFv-JY for pgsql-general@postgresql.org; Sun, 01 Dec 2024 20:36:43 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-aa5302a0901so448684166b.0 for ; Sun, 01 Dec 2024 12:36:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733085400; x=1733690200; darn=postgresql.org; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=pUGz31KlKdvIYn5CnhrKPG0fKOPLdbv7Tg2nky2QkFE=; b=GKSpwhat5cfNek/KBy4EdabBP7N+1ks3RwLylNq3bfrjiRcRmON+NmoyATBYTtWkAD 8gchoJWJkxnqOy697nyrpjNUXnExKF50G7vB8FOs0MEKOsJpHDb/cnxSBLbxAIvSLp4b qrPlsVRSahGoHDpTKmu/PHdXCwKWsnn31MQaTxlGz7iwy4E3UuChF447c6iXyp9+JUSe m3dALWQtDF/CmfJqIsjVfjJIWFmUo1PqvUKOFnZXyWT/CN3LFkwDpMqrKBrY7kzvQdxB sJu+P7ZoLfVnAhxT4Ra2k9hTR4reCvpfxv/KyjuVSw5NPOCIpG3004/yleS69F8f6rIu i29w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733085400; x=1733690200; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pUGz31KlKdvIYn5CnhrKPG0fKOPLdbv7Tg2nky2QkFE=; b=Y2RhB/Vk/58fBr6BE71FNP8UQcCx4I/JTF7Mid78glwhx2ndtkUH+iof9/883Owf0r dF+fos5wFSlYtS4Ml0V8hsNLBJo1dxGvUFMJxUr4QJB/A0WmCsVCNLq2L03QpQ4xdu4O yawHnjzrIqjLg3VSqBwYQs294N4F0YwtjAXHyx39qMizlZorxPSXlVEZug4M1odnJdMu HldYg4rLyWN1CwH4xqh206Wk2zz8MGm0GdjNjvod6hnHiK5YPV/Mgvx5lr5pcHh3EepY VTPbI5I81rCtU3amHA/3hyFHgKGZ11RZcTmFFUEdHoRr8kyKLcjJWRucrw/v7EYaDQZ9 GURw== X-Gm-Message-State: AOJu0YxyQCllugS/rVDAk+wfswSqBNny40WN/bQNmtOa1cAtSHAH7UHX SzBTYWdoOQjjDdcShirq9T2CqTDDb9fcanl4KvXj+Q23pmW5Bx2kwbxoIYbDfIM2Ms12ty6nY+j mw2cS4zthtjsqLTsjsr1KK+EgUwR+An7h X-Gm-Gg: ASbGncsBtWxN81JeULtv2vrLak2Yl4FE6nK+g2SX+qRYr4sm+UCjnq9ILq9+TLQjpXr vm1NZgWSL8sihmlymVTmixuD9O5fY5k+mC2S3EE+IdkL12bBUcl/O+7VheRJhB4W+PQ== X-Google-Smtp-Source: AGHT+IEglBRCh1UsFJgMAVBQ1aTJ1d+I4aWFSNaScBbAc9N2abbThlFndyVEzJddZ/oL/hy0PK3+S1k8UHoSPB3jud8= X-Received: by 2002:a17:906:32ce:b0:aa5:31bb:2d with SMTP id a640c23a62f3a-aa580f259demr1839129466b.20.1733085399625; Sun, 01 Dec 2024 12:36:39 -0800 (PST) MIME-Version: 1.0 References: <1454490.1733083127@sss.pgh.pa.us> In-Reply-To: <1454490.1733083127@sss.pgh.pa.us> From: Alexander Farber Date: Sun, 1 Dec 2024 21:36:28 +0100 Message-ID: Subject: Re: Connection to 127.0.0.1 refused in a Dockerfile based on postgres:17-alpine3.20 Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000009c3c3706283b6371" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009c3c3706283b6371 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you, Tom - On Sun, Dec 1, 2024 at 8:58=E2=80=AFPM Tom Lane wrote: > Alexander Farber writes: > > TLDR "psql words_de" works, but "psql -h localhost words_de" does not > > I'd try connecting the first way and seeing what "show > listen_addresses" gives. Per your report it should be "*", > but maybe something is overriding that. > > If it is "*", then it seems like something is interfering with > expanding that. Maybe try explicitly setting it to "localhost"? > it is empty in my docker container (but "localhost" on my prod server), so I probably need to investigate that... $ psql words_de psql (17.2) Type "help" for help. words_de=3D> show listen_addresses; listen_addresses ------------------ (1 row) words_de=3D> set listen_addresses=3D'localhost'; ERROR: parameter "listen_addresses" cannot be changed without restarting the server # grep listen_addresses $PGDATA/postgresql.conf listen_addresses =3D '*' --0000000000009c3c3706283b6371 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank y= ou, Tom -

On Sun, Dec 1, 2024 at 8:58=E2=80=AFPM Tom L= ane <tgl@sss.pgh.pa.us> wrot= e:
Alexander Far= ber <ale= xander.farber@gmail.com> writes:
> TLDR "psql words_de" works, but "psql -h localhost word= s_de" does not

I'd try connecting the first way and seeing what "show
listen_addresses" gives.=C2=A0 Per your report it should be "*&qu= ot;,
but maybe something is overriding that.

If it is "*", then it seems like something is interfering with expanding that.=C2=A0 Maybe try explicitly setting it to "localhost&qu= ot;?

it is empty in my docker container (but "= ;localhost" on my prod server),
so I probably need to investigate = that...

$ psql words_de
psql (17.2)
Type &q= uot;help" for help.

words_de=3D> show list= en_addresses;
=C2=A0listen_addresses=C2=A0
------------= ------
=C2=A0
(1 row)

words_de= =3D> set listen_addresses=3D'localhost';
ERROR:=C2=A0 = parameter "listen_addresses" cannot be changed without restarting= the server

# grep listen_addresses $PGDATA/postgresql.conf
listen_addresses =3D '*'


=
--0000000000009c3c3706283b6371--