listening on an address other than 'localhost'?

From: "Johnson, Bruce E - (bjohnson)" <Johnson(at)pharmacy(dot)arizona(dot)edu>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: listening on an address other than 'localhost'?
Date: 2023-09-06 19:23:19
Message-ID: FEB5A474-B2D2-42B7-8D5D-FEF3B4564306@email.arizona.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

per the documentation to listen for client connections on a given IP address you set listen_addresses to a commaspearated list of IP addresses in postgresql.conf

That line is commented out in the default conf file, when I uncomment it, and add the address, then do sudo systemctl restart postgresql the postgres processes are not running afterwards.

root(at)dhbpostgres:/home/johnson# ps -aux | grep postgres
root 1452 0.0 0.0 6608 2364 pts/1 S+ 19:07 0:00 grep --color=auto postgres
root(at)dhbpostgres:/home/johnson# vi /etc/postgresql/15/main/postgresql.conf <<commented out listen_addresses
root(at)dhbpostgres:/home/johnson# systemctl restart postgresql
root(at)dhbpostgres:/home/johnson# ps -aux | grep postgres
postgres 1461 0.2 0.1 219220 30568 ? Ss 19:08 0:00 /usr/lib/postgresql/15/bin/postgres -D /opt/data/pgdata -c config_file=/etc/postgresql/15/main/postgresql.conf
postgres 1462 0.0 0.0 219352 7028 ? Ss 19:08 0:00 postgres: 15/main: checkpointer
postgres 1463 0.0 0.0 219220 7024 ? Ss 19:08 0:00 postgres: 15/main: background writer
postgres 1465 0.0 0.0 219220 7032 ? Ss 19:08 0:00 postgres: 15/main: walwriter
postgres 1466 0.0 0.0 220816 9508 ? Ss 19:08 0:00 postgres: 15/main: autovacuum launcher
postgres 1467 0.0 0.0 220792 9444 ? Ss 19:08 0:00 postgres: 15/main: logical replication launcher
root 1480 0.0 0.0 6608 2276 pts/1 S+ 19:08 0:00 grep --color=auto postgres

If I comment that line out as it was in the beginning, and restart, it runs.

the syslog gives me the error

Sep 6 19:06:01 dhbpostgres postgresql(at)15-main[1538]: 2023-09-06 19:06:01.181 GMT [1543] LOG: syntax error in file "/etc/postgresql/15/main/postgresql.conf" line 63, near token ".206"

which corresponds to the listen_addresses line in the config file and is part of the address…

#listen_addresses = 10.128.206.109 # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)

What am I missing? (postgresql 15.4 running on Ubuntu 22.04), installed via postgresql.org<http://postgresql.org> apt repo.

--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2023-09-06 19:31:31 Re: Ynt: Pgbackrest Restore Error - Segmentation fault (core dumped)
Previous Message Imre Samu 2023-09-06 18:42:15 Re: running ANALYZE results in => duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index"