列出需要服务器重启的 PostgreSQL 配置项
某些 PostgreSQL 配置项 - 通常在 postgresql.conf
中设置 - 需要服务器重启才能生效。
使用视图 pg_settings
列出需要重启的项
SELECT name FROM pg_settings WHERE context='postmaster'
从 PostgreSQL 9.5 开始,pg_settings
包含一个字段 pending_restart
,它指示需要服务器重启才能生效的配置项已更改并正在等待重启。
在 PostgreSQL 16 中,这些设置是
- archive_mode
- autovacuum_freeze_max_age
- autovacuum_max_workers
- autovacuum_multixact_freeze_max_age
- bonjour
- bonjour_name
- cluster_name
- config_file
- data_directory
- data_sync_retry
- debug_io_direct
- dynamic_shared_memory_type
- event_source
- external_pid_file
- hba_file
- hot_standby
- huge_page_size
- huge_pages
- ident_file
- ignore_invalid_pages
- jit_provider
- listen_addresses
- logging_collector
- max_connections
- max_files_per_process
- max_locks_per_transaction
- max_logical_replication_workers
- max_pred_locks_per_transaction
- max_prepared_transactions
- max_replication_slots
- max_wal_senders
- max_worker_processes
- min_dynamic_shared_memory
- old_snapshot_threshold
- port
- recovery_target
- recovery_target_action
- recovery_target_inclusive
- recovery_target_lsn
- recovery_target_name
- recovery_target_time
- recovery_target_timeline
- recovery_target_xid
- reserved_connections
- shared_buffers
- shared_memory_type
- shared_preload_libraries
- superuser_reserved_connections
- track_activity_query_size
- track_commit_timestamp
- unix_socket_directories
- unix_socket_group
- unix_socket_permissions
- wal_buffers
- wal_decode_buffer_size
- wal_level
- wal_log_hints
另请参阅:PostgreSQL 文档 - pg_settings