-- configs requiring postgresql restart
select name, setting, context
from pg_settings where context = 'postmaster';

postgres=# select name, setting, context
postgres-# from pg_settings where context = 'postmaster';
name | setting | context
-------------------------------------+-----------------------------------------------+------------
allow_system_table_mods | off | postmaster
archive_mode | off | postmaster
autovacuum_freeze_max_age | 200000000 | postmaster
autovacuum_max_workers | 3 | postmaster
autovacuum_multixact_freeze_max_age | 400000000 | postmaster
bonjour | off | postmaster
bonjour_name | | postmaster
cluster_name | | postmaster
config_file | /usr/local/pgtest/bin/../data/postgresql.conf | postmaster
data_directory | /usr/local/pgtest/bin/../data | postmaster
dynamic_shared_memory_type | posix | postmaster
event_source | PostgreSQL | postmaster
external_pid_file | | postmaster
hba_file | /usr/local/pgtest/bin/../data/pg_hba.conf | postmaster
hot_standby | off | postmaster
huge_pages | try | postmaster
ident_file | /usr/local/pgtest/bin/../data/pg_ident.conf | postmaster
listen_addresses | * | postmaster
logging_collector | off | postmaster
max_connections | 100 | postmaster
max_files_per_process | 1000 | postmaster
max_locks_per_transaction | 64 | postmaster
max_pred_locks_per_transaction | 64 | postmaster
max_prepared_transactions | 0 | postmaster
max_replication_slots | 0 | postmaster
max_wal_senders | 0 | postmaster
max_worker_processes | 8 | postmaster
port | 5432 | postmaster
shared_buffers | 16384 | postmaster
shared_preload_libraries | | postmaster
ssl | off | postmaster
ssl_ca_file | | postmaster
ssl_cert_file | server.crt | postmaster
ssl_ciphers | none | postmaster
ssl_crl_file | | postmaster
ssl_ecdh_curve | none | postmaster
ssl_key_file | server.key | postmaster
ssl_prefer_server_ciphers | on | postmaster
superuser_reserved_connections | 3 | postmaster
track_activity_query_size | 1024 | postmaster
track_commit_timestamp | off | postmaster
unix_socket_directories | /tmp | postmaster
unix_socket_group | | postmaster
unix_socket_permissions | 0777 | postmaster
wal_buffers | 512 | postmaster
wal_level | minimal | postmaster
wal_log_hints | off | postmaster

-- configs requiring postgresql reload
select name, setting, context
from pg_settings where context = 'sighup';

postgres=# select name, setting, context
postgres-# from pg_settings where context = 'sighup';
name | setting | context
---------------------------------+--------------------------------+---------
archive_command | (disabled) | sighup
archive_timeout | 0 | sighup
authentication_timeout | 60 | sighup
autovacuum | on | sighup
autovacuum_analyze_scale_factor | 0.1 | sighup
autovacuum_analyze_threshold | 50 | sighup
autovacuum_naptime | 60 | sighup
autovacuum_vacuum_cost_delay | 20 | sighup
autovacuum_vacuum_cost_limit | -1 | sighup
autovacuum_vacuum_scale_factor | 0.2 | sighup
autovacuum_vacuum_threshold | 50 | sighup
autovacuum_work_mem | -1 | sighup
bgwriter_delay | 200 | sighup
bgwriter_lru_maxpages | 100 | sighup
bgwriter_lru_multiplier | 2 | sighup
checkpoint_completion_target | 0.5 | sighup
checkpoint_timeout | 300 | sighup
checkpoint_warning | 30 | sighup
db_user_namespace | off | sighup
fsync | on | sighup
full_page_writes | on | sighup
hot_standby_feedback | off | sighup
krb_caseins_users | off | sighup
krb_server_keyfile | | sighup
log_autovacuum_min_duration | -1 | sighup
log_checkpoints | off | sighup
log_destination | stderr | sighup
log_directory | pg_log | sighup
log_file_mode | 0600 | sighup
log_filename | postgresql-%Y-%m-%d_%H%M%S.log | sighup
log_hostname | off | sighup
log_line_prefix | | sighup
log_rotation_age | 1440 | sighup
log_rotation_size | 10240 | sighup
log_timezone | US/Pacific | sighup
log_truncate_on_rotation | off | sighup
max_standby_archive_delay | 30000 | sighup
max_standby_streaming_delay | 30000 | sighup
max_wal_size | 64 | sighup
min_wal_size | 5 | sighup
pre_auth_delay | 0 | sighup
restart_after_crash | on | sighup
stats_temp_directory | pg_stat_tmp | sighup
synchronous_standby_names | | sighup
syslog_facility | local0 | sighup
syslog_ident | postgres | sighup
trace_recovery_messages | log | sighup
vacuum_defer_cleanup_age | 0 | sighup
wal_keep_segments | 0 | sighup
wal_receiver_status_interval | 10 | sighup
wal_receiver_timeout | 60000 | sighup
wal_retrieve_retry_interval | 5000 | sighup
wal_sender_timeout | 60000 | sighup
wal_sync_method | fdatasync | sighup
wal_writer_delay | 200 | sighup

postgres=# select name ,context from pg_settings;
name | context
-------------------------------------+-------------------
allow_system_table_mods | postmaster
application_name | user
archive_command | sighup
archive_mode | postmaster
archive_timeout | sighup
array_nulls | user
authentication_timeout | sighup
autovacuum | sighup
autovacuum_analyze_scale_factor | sighup
autovacuum_analyze_threshold | sighup
autovacuum_freeze_max_age | postmaster
autovacuum_max_workers | postmaster
autovacuum_multixact_freeze_max_age | postmaster
autovacuum_naptime | sighup
autovacuum_vacuum_cost_delay | sighup
autovacuum_vacuum_cost_limit | sighup
autovacuum_vacuum_scale_factor | sighup
autovacuum_vacuum_threshold | sighup
autovacuum_work_mem | sighup
backslash_quote | user
bgwriter_delay | sighup
bgwriter_lru_maxpages | sighup
bgwriter_lru_multiplier | sighup
block_size | internal
bonjour | postmaster
bonjour_name | postmaster
bytea_output | user
check_function_bodies | user
checkpoint_completion_target | sighup
checkpoint_timeout | sighup
checkpoint_warning | sighup
client_encoding | user
client_min_messages | user
cluster_name | postmaster

......

对于context有多种可能的取值

internal

这些设置不能被直接修改,它们反映了内部决定的值。某些可能在使用不同配置选项重建系统时或者改变initdb的选项时可以调整。

postmaster

这些设置只能在服务器启动时应用,因此任何修改都需要重启服务器。这些设置的值通常都存储在postgresql.conf文件中,或者在启动服务器时通过命令行传递。当然,具有更低context类型的设置也可以在服务器启动时间被设置。

sighup

对于这些设置的修改可以在postgresql.conf中完成并且不需要重启服务器。发

送一个SIGHUP信号给postmaster会导致它重新读取postgresql.conf并应用修改。Postmaster将会把SIGHUP信号传递给它的孩子进程,这样它们也会获得新的值。

backend

对于这些设置的修改可以在postgresql.conf中完成并且不需要重启服务器。它们也可以在一个连接请求包(例如,通过libpq的PGOPTIONS环境变量)中为一个特定会话设置。然而,这些设置在会话启动后永不变化。如果你在postgresql.conf中修改它们,可以向postmaster发送一个SIGHUP信号让它重读postgresql.conf。新值只会影响后续启动的会话。

superuser

这些设置可以从postgresql.conf设置,或者在会话中用SET命令设置。仅当没有通过SET设置会话本地值时,postgresql.conf中的改变才会影响现有的会话。

user

这些设置可以从postgresql.conf设置,或者在会话中用SET命令设置。任何用户都被允许修改它的会话本地值。仅当没有通过SET设置会话本地值时,postgresql.conf中的改变才会影响现有的会话。

pg_settings视图不能被插入或者从中删除,但是它可以被更新。在pg_settings的一行上的一个UPDATE等价于在该参数上执行一个SET命令。修改将只会影响当前会话使用的值。如果一个UPDATE在一个后来中断的事务中被发出,UPDATE命令的效果也会随着事务的回滚而消失。一旦所在的事务被提交,效果将一直保持到会话结束,除非有其他UPDATE或SET重新修改它。

configs for postgresql restart and postgresql reload的更多相关文章

  1. PostgreSQL入门,PostgreSQL和mysql

    PostgreSQL被誉为“世界上功能最强大的开源数据库”,是以加州大学伯克利分校计算机系开发的POSTGRES 4.2为基础的对象关系型数据库管理系统. PostgreSQL支持大部分 SQL标准并 ...

  2. Mac安装postgresql和卸载PostgreSQL

    1.homebrew安装 brew install postgresql 2.初始化 initdb /usr/local/var/postgres 3.创建数据库及查看数据库 (1)先创建db. cr ...

  3. PostgreSQL——服务器配置_{postgresql.conf}

    一.设置参数 所有参数名称都是不区分大小写的 值为字符串时,需要单引号 值为数值时不需要单引号,但带单位时,需要单引号 配置文件(如:postgresql.conf.postgresql.auto.c ...

  4. [PostgreSQL] 图解安装 PostgreSQL

    图解安装 PostgreSQL [博主]反骨仔 [原文地址]http://www.cnblogs.com/liqingwen/p/5894462.html 序 园友的一篇<Asp.Net Cor ...

  5. PostgreSQL configuration file postgresql.conf recommanded settings and how it works

    1        Set max_connections to three times the number of processor cores on the server. Include vir ...

  6. 【PostgreSQL 15】PostgreSQL 15对UNIQUE和NULL的改进

    用一句话来总结这种改进就是: 支持唯一性约束和索引将null值视为相同的值.之前是将null值索引成不同的值,现在可以通过使用unique nulls not distinct创建约束,将null值视 ...

  7. UbuntuでPostgreSQLをインストールからリモートアクセスまでの手順

    PostgreSQLサーバの立ち上げに少しハマりましたので.メモしておきます. OS: Ubuntu14.04 LTS インストール 最初はPostgreSQLをインストールします.普通にapt-ge ...

  8. service postgresql initdb [FAILED]

    一.场景 安装postgresql时可能因为配置有问题[后来定位问题是我把pg_hba.conf中local一栏的ident修改为peer就会出错]导致服务起不来,报错如下: [root@localh ...

  9. Ubuntu 12.04环境下配置Postgresql和phppgadmin

    Ubuntu 12.04环境下配置Postgresql 9.1 和phppgadmin 本系列文章由ex_net(张建波)编写,转载请注明出处. http://blog.csdn.net/zjianb ...

随机推荐

  1. Myeclipse配置 项目编码格式

    修改MyEclipse 工作空间的编码 修改之后,在该工作空间下创建的任何项目,编码都是UTF-8,既,该项目下所有文件都是utf-8 格式,工作空间影响项目,项目影响文件 General --> ...

  2. spring容器IOC创建对象<二>

    问题?spring是如何创建对象的?什么时候创建对象?有几种创建方式?测试对象是单例的还是多例的 ?对象的初始化和销毁? 下面的四大模块IOC的内容了!需要深刻理解 SpringIOC定义:把对象的创 ...

  3. FW Docker为容器分配指定物理网段的静态IP

    官方有关于网桥和IP配置的文档地址:https://docs.docker.com/articles/networking/ 1.宿主机(系统采用ubuntu-14.04.1-server-amd64 ...

  4. Div自适应高度的方法

    http://www.yutheme.cn/website/index.php/content/view/39/63.html div高度自适应是个比较麻烦的问题,在朋友artery那里看到这个文章, ...

  5. 使用NSTimer过程中最大的两个坑

    坑1. retain cycle问题. 在一个对象中使用循环执行的nstimer时,若希望在对象的dealloc方法中释放这个nstimer,结局会让你很失望. 这个timer会导致你的对象根本不会被 ...

  6. Mixing Delphi and C++(相互调用)

    Mixing Delphi and C++ You have a TStringList and <algorithm>. What can you do? Quite a lot, ac ...

  7. QLineEdit 仿QQ签名框(思路很独特:用QSS::hover显示额外的图片)

    今天鼓捣了半天,终于实现了自定义Qt中的QlineEdit控件的大致效果. 这个问题对于新手而言,主要有以下几个难点: 1.继承QLineEdit控件 2.QSS设置QLineEdit的相关样式,可以 ...

  8. angularJS的$watch和$apply

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  9. Intersecting Lines---poj1269(求两直线的位置关系)

    题目链接:http://poj.org/problem?id=1269 题意:给你两条直线上的任意不同的两点,然后求两条直线的位置关系,如果相交于一点输出该点坐标; #include<iostr ...

  10. sql 主外键

    alter table Orders add CONSTRAINT fk_PerOrders FOREIGN KEY(id) REFERENCES Persons(Id) 以上SQL中,Persons ...