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 1rhBZU-00A5F2-6e for pgsql-docs@arkaria.postgresql.org; Mon, 04 Mar 2024 16:53:49 +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 1rhBZS-009UNl-RU for pgsql-docs@arkaria.postgresql.org; Mon, 04 Mar 2024 16:53:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhBZR-009UNc-6g for pgsql-docs@lists.postgresql.org; Mon, 04 Mar 2024 16:53:47 +0000 Received: from fhigh1-smtp.messagingengine.com ([103.168.172.152]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhBZM-002pRp-Py for pgsql-docs@lists.postgresql.org; Mon, 04 Mar 2024 16:53:44 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 7B3171140107; Mon, 4 Mar 2024 11:53:40 -0500 (EST) Received: from imap49 ([10.202.2.99]) by compute2.internal (MEProxy); Mon, 04 Mar 2024 11:53:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1709571220; x=1709657620; bh=PbD/Gcf3II CZcMojf5/PlFAG5xA7lzcZLiu/XGHZ0gg=; b=Jx3fN2oFpBjsMEymho4d8QXJK4 8aq7xVqiyBdlyQAu5a1HveH2Wf33EMIw9HpgUEWObmXwY2+RhwmiuHLh7Apwecss KeJp/XDWKvJYUNKEkLWotprau0Tg2x8n/t07ChcRpYtPQCt0AohXgAqN053HklIj 8xYiyRqn+bicYAsHjMFdcjG+rhB7Ww2rEnZP72/yrvYY20AtRRDs2+rkp1FP03YK CXwYNLhDP1AXtk3ku9yycna9YhhSDK8kifGk5+eOZp8itWDqw2ezqqASEdLIMwAN 9O47DsYvkXmF3XnWEeFIt7XjvFSyJB6irHnh1XC/Ehd+ldxDW/LqqukhIyYw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709571220; x=1709657620; bh=PbD/Gcf3IICZcMojf5/PlFAG5xA7 lzcZLiu/XGHZ0gg=; b=bIOZNQF8f54jMWHTnNeOP47LReKlD1gQpm8umDVEQ6v8 IO1tNrIPpTCmAZJSLsrgefwOdj3uXBbBOJ0+pzxNFa4p4NBGPp2/78nQdZDGNfW6 FM76V0PgJXpGspQQA9KDmkPr/9t/opZsFBHId47H+ia3ScqKoWnUb677ahCKh0JS +RhcN216fjmPEgynjpbtCDpa7pAYi8DLUifRU0KN6hW72wVxVrPBW0PWGD8CRIVc pNtxbM6s8HIM81gREyBaNa4G+ohIi4AFzjTaA4k+ClpvPNc0KoLDpZJ8Dxc+XN9h SxBtle40u/cYA2bzWqwt29Wl6NC5vfJnVBopo19cfA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheejgdelvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesrgdtre erreertdenucfhrhhomhepfdfguhhlvghrucfvrghvvghirhgrfdcuoegvuhhlvghrsegv uhhlvghrthhordgtohhmqeenucggtffrrghtthgvrhhnpedtjeffieeuieeggeehieeutd evleetteejiedtgfehheefueekvefftedujefhffenucffohhmrghinhepphhoshhtghhr vghsqhhlrdhorhhgpdgvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvuhhlvghrsegvuhhlvghrthho rdgtohhm X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 15ED915A0092; Mon, 4 Mar 2024 11:53:39 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-208-g3f1d79aedb-fm-20240301.002-g3f1d79ae MIME-Version: 1.0 Message-Id: <732971c0-dfc9-4b4e-ae13-980d1517a498@app.fastmail.com> In-Reply-To: <170949386083.644.3898742260684710908@wrigleys.postgresql.org> References: <170949386083.644.3898742260684710908@wrigleys.postgresql.org> Date: Mon, 04 Mar 2024 13:53:19 -0300 From: "Euler Taveira" To: hirnstrom@arcor.de, pgsql-docs@lists.postgresql.org Subject: Re: documentation issue: listen_addresses does NOT take a comma-separated list of host names Content-Type: multipart/alternative; boundary=4a3e4ff105364c5b93be42921a940984 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --4a3e4ff105364c5b93be42921a940984 Content-Type: text/plain On Sun, Mar 3, 2024, at 4:24 PM, PG Doc comments form wrote: > listen_addresses (string) > > Specifies the TCP/IP address(es) on which the server is to listen for > connections from client applications. The value takes the form of a > comma-separated list of host names and/or numeric IP addresses. (...) > > I tried different versions of names and IPs, quoted in single, double and no > quotes at all, comma separated between quotes and inside, like > > listen_addresses = '192.168.32.3','127.0.0.1' > # or > listen_addresses = '192.168.32.3,127.0.0.1' > Any parameter that has a string type are enclosed in single quotes [1]. Hence, a list of addresses consists of listen_addresses = 'W, X, Y, Z' > but `sudo journalctl -eb -u postgresql@14-main.service -o cat` > gives me: > > Reloading PostgreSQL Cluster 14-main... > Error: invalid line 61 in /etc/postgresql/14/main/postgresql.conf: > listen_addresses = "192.168.32.3","127.0.0.1" > postgresql@14-main.service: Control process exited, code=exited, > status=1/FAILURE You use double quotes for each individual address. > Reload failed for PostgreSQL Cluster 14-main. > Reloading PostgreSQL Cluster 14-main... > Error: invalid line 61 in /etc/postgresql/14/main/postgresql.conf: > listen_addresses = "192.168.32.3,127.0.0.1" > postgresql@14-main.service: Control process exited, code=exited, > status=1/FAILURE You are using double quotes. It would work if you just replaced it with single quotes. > Reload failed for PostgreSQL Cluster 14-main. > Reloading PostgreSQL Cluster 14-main... > Error: invalid line 61 in /etc/postgresql/14/main/postgresql.conf: > listen_addresses = '192.168.32.3','127.0.0.1' > postgresql@14-main.service: Control process exited, code=exited, > status=1/FAILURE Again, you are using multiple strings separated by comma instead of just one string. > Reload failed for PostgreSQL Cluster 14-main. > > > So I tried to follow the otherwise seen pattern and wrote into > postgresql.conf: > > listen_addresses = '192.168.32.3' > listen_addresses = '127.0.0.1' > > which worked. It worked but it is just listening to 127.0.0.1. $ tail -n 2 $PGDATA/postgresql.conf listen_addresses = '192.168.32.3' listen_addresses = '127.0.0.1' $ pg_ctl start waiting for server to start....2024-03-04 13:50:37.167 -03 [16738] LOG: redirecting log output to logging collector process 2024-03-04 13:50:37.167 -03 [16738] HINT: Future log output will appear in directory "log". done server started $ postgres -C listen_addresses 127.0.0.1 [1] https://www.postgresql.org/docs/current/runtime-config-connection.html -- Euler Taveira EDB https://www.enterprisedb.com/ --4a3e4ff105364c5b93be42921a940984 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Sun, Mar 3, = 2024, at 4:24 PM, PG Doc comments form wrote:
listen_addresses (string)

    Specifies the TCP/IP address(es) on w= hich the server is to listen for
connections from client a= pplications. The value takes the form of a
comma-separated= list of host names and/or numeric IP addresses.  (...)
</quote> 
I tried different versions of name= s and IPs, quoted in single, double and no
quotes at all, = comma separated between quotes and inside, like 
<= quote> 
listen_addresses =3D '192.168.32.3','127.0= .0.1'
# or
listen_addresses =3D '192.168.32.= 3,127.0.0.1'
</quote>
Any parameter that has a string type are enclosed in single = quotes [1]. Hence,
a list of addresses consists of

listen_addresses =3D 'W, X, Y, Z'

 but `sudo = journalctl -eb -u pos= tgresql@14-main.service -o cat`
gives me:
<quote> 
Reloading PostgreSQL Cluster 14-main= ...
Error: invalid line 61 in /etc/postgresql/14/main/post= gresql.conf:
listen_addresses =3D "192.168.32.3","127.0.0.= 1"
postgresq= l@14-main.service: Control process exited, code=3Dexited,
<= div>status=3D1/FAILURE

You use= double quotes for each individual address.

Reload failed for Postgr= eSQL Cluster 14-main.
Reloading PostgreSQL Cluster 14-main= ...
Error: invalid line 61 in /etc/postgresql/14/main/post= gresql.conf:
listen_addresses =3D "192.168.32.3,127.0.0.1"=
postgresql@= 14-main.service: Control process exited, code=3Dexited,
status=3D1/FAILURE

You are u= sing double quotes. It would work if you just replaced it with single
quotes.

Reload failed for PostgreSQL Cluster 14-main.
Reloading PostgreSQL Cluster 14-main...
Error:= invalid line 61 in /etc/postgresql/14/main/postgresql.conf:
listen_addresses =3D '192.168.32.3','127.0.0.1'
postgresql@14-main.service: C= ontrol process exited, code=3Dexited,
status=3D1/FAILURE

Again, you are using multiple s= trings separated by comma instead of just
one string.
<= /div>

= Reload failed for PostgreSQL Cluster 14-main.
</quote&g= t; 

So I tried to follow the otherwise= seen pattern and wrote into
postgresql.conf: 
<quote> 
listen_addresses =3D '192.168.= 32.3' 
listen_addresses =3D '127.0.0.1'
</quote> 
which worked. 

It worked but it is just listening to 127.0.0.= 1.

$ tail -n 2 $PGDATA/postgresql.conf
listen_addresses =3D '192.168.32.3'
listen_addresses= =3D '127.0.0.1'
$ pg_ctl start
waiting for = server to start....2024-03-04 13:50:37.167 -03 [16738] LOG:  redire= cting log output to logging collector process
2024-03-04 1= 3:50:37.167 -03 [16738] HINT:  Future log output will appear in dir= ectory "log".
done
server started
<= div>$ postgres -C listen_addresses
127.0.0.1



=

-= -
Euler Taveira

--4a3e4ff105364c5b93be42921a940984--