pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feeddocumentation issue: listen_addresses does NOT take a comma-separated list of host names
2+ messages / 2 participants
[nested] [flat]
* documentation issue: listen_addresses does NOT take a comma-separated list of host names
@ 2024-03-03 19:24 PG Doc comments form <noreply@postgresql.org>
2024-03-04 16:53 ` Re: documentation issue: listen_addresses does NOT take a comma-separated list of host names Euler Taveira <euler@eulerto.com>
0 siblings, 1 reply; 2+ messages in thread
From: PG Doc comments form @ 2024-03-03 19:24 UTC (permalink / raw)
To: pgsql-docs@lists.postgresql.org; +Cc: hirnstrom@arcor.de
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/14/runtime-config-connection.html
Description:
In the documentation, I read:
<quote>
20.3.1. Connection Settings
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. (...)
</quote>
I tried different versions of names and IPs, quoted in single, double and no
quotes at all, comma separated between quotes and inside, like
<quote>
listen_addresses = '192.168.32.3','127.0.0.1'
# or
listen_addresses = '192.168.32.3,127.0.0.1'
</quote>
but `sudo journalctl -eb -u postgresql@14-main.service -o cat`
gives me:
<quote>
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
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
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
Reload failed for PostgreSQL Cluster 14-main.
</quote>
So I tried to follow the otherwise seen pattern and wrote into
postgresql.conf:
<quote>
listen_addresses = '192.168.32.3'
listen_addresses = '127.0.0.1'
</quote>
which worked.
Note, that in the file itself, the comment repeats the (imho)
misinformation.
<quote>
#listen_addresses = 'localhost' # what IP address(es) to listen on;
# comma-separated list of addresses;
</quote>
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: documentation issue: listen_addresses does NOT take a comma-separated list of host names
2024-03-03 19:24 documentation issue: listen_addresses does NOT take a comma-separated list of host names PG Doc comments form <noreply@postgresql.org>
@ 2024-03-04 16:53 ` Euler Taveira <euler@eulerto.com>
0 siblings, 0 replies; 2+ messages in thread
From: Euler Taveira @ 2024-03-04 16:53 UTC (permalink / raw)
To: hirnstrom@arcor.de; pgsql-docs@lists.postgresql.org
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. (...)
> </quote>
> I tried different versions of names and IPs, quoted in single, double and no
> quotes at all, comma separated between quotes and inside, like
> <quote>
> listen_addresses = '192.168.32.3','127.0.0.1'
> # or
> listen_addresses = '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 = 'W, X, Y, Z'
> but `sudo journalctl -eb -u postgresql@14-main.service -o cat`
> gives me:
> <quote>
> 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.
> </quote>
>
> So I tried to follow the otherwise seen pattern and wrote into
> postgresql.conf:
> <quote>
> listen_addresses = '192.168.32.3'
> listen_addresses = '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 = '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/
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2024-03-04 16:53 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-03 19:24 documentation issue: listen_addresses does NOT take a comma-separated list of host names PG Doc comments form <noreply@postgresql.org>
2024-03-04 16:53 ` Euler Taveira <euler@eulerto.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox