Параметры, изменение которых требует перезапуска сервера

=> SELECT name, setting, unit FROM pg_settings WHERE context = 'postmaster';
                name                 |                setting                | unit 
-------------------------------------+---------------------------------------+------
 allow_system_table_mods             | off                                   | 
 archive_mode                        | off                                   | 
 autovacuum_freeze_max_age           | 200000000                             | 
 autovacuum_max_workers              | 3                                     | 
 autovacuum_multixact_freeze_max_age | 400000000                             | 
 bonjour                             | off                                   | 
 bonjour_name                        |                                       | 
 cluster_name                        |                                       | 
 config_file                         | /usr/local/pgsql/data/postgresql.conf | 
 data_directory                      | /usr/local/pgsql/data                 | 
 dynamic_shared_memory_type          | posix                                 | 
 event_source                        | PostgreSQL                            | 
 external_pid_file                   |                                       | 
 hba_file                            | /usr/local/pgsql/data/pg_hba.conf     | 
 hot_standby                         | on                                    | 
 huge_pages                          | try                                   | 
 ident_file                          | /usr/local/pgsql/data/pg_ident.conf   | 
 listen_addresses                    | localhost                             | 
 logging_collector                   | off                                   | 
 max_connections                     | 100                                   | 
 max_files_per_process               | 1000                                  | 
 max_locks_per_transaction           | 64                                    | 
 max_logical_replication_workers     | 4                                     | 
 max_pred_locks_per_transaction      | 64                                    | 
 max_prepared_transactions           | 0                                     | 
 max_replication_slots               | 10                                    | 
 max_wal_senders                     | 10                                    | 
 max_worker_processes                | 8                                     | 
 old_snapshot_threshold              | -1                                    | min
 port                                | 5432                                  | 
 shared_buffers                      | 16384                                 | 8kB
 shared_preload_libraries            |                                       | 
 superuser_reserved_connections      | 3                                     | 
 track_activity_query_size           | 1024                                  | 
 track_commit_timestamp              | off                                   | 
 unix_socket_directories             | /tmp                                  | 
 unix_socket_group                   |                                       | 
 unix_socket_permissions             | 0777                                  | 
 wal_buffers                         | 512                                   | 8kB
 wal_level                           | replica                               | 
 wal_log_hints                       | off                                   | 
(41 rows)

Установка listen_addresses

Изменяем файл редактором sed (с тем же успехом можно воспользоваться любым другим редактором):

=> \! sed "s/.*listen_addresses =.*/listen_addresses = '*'/" -i /usr/local/pgsql/data/postgresql.conf

Убедимся, что новое значение есть в файле и ждет перезапуска сервера:

=> SELECT * FROM pg_file_settings WHERE name = 'listen_addresses'\gx
-[ RECORD 1 ]-------------------------------------
sourcefile | /usr/local/pgsql/data/postgresql.conf
sourceline | 59
seqno      | 1
name       | listen_addresses
setting    | *
applied    | f
error      | setting could not be applied

=> SELECT name, setting, pending_restart FROM pg_settings WHERE name = 'listen_addresses';
       name       |  setting  | pending_restart 
------------------+-----------+-----------------
 listen_addresses | localhost | t
(1 row)

Применение и проверка

=> \q
postgres$ pg_ctl -w -l /home/postgres/logfile -D /usr/local/pgsql/data restart
waiting for server to shut down.... done
server stopped
waiting for server to start.... done
server started
postgres$ psql 
=> SHOW listen_addresses;
 listen_addresses 
------------------
 *
(1 row)