-- 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. SQLite(快速上手版)笔记

    原文 1. SQL语法关键字 关键字 描述 Create Table 创建数据表 Alter Table 修改数据表 Drop Table 删除数据表 Create Index 创建索引 Drop I ...

  2. css 鼠标移动到按钮图片改变;图片换层;鼠标放上透明度改变直到隐藏;

    css 鼠标移动到按钮图片改变: 方法一: <style> .pp a { width:575px; height:157px; background:url(1.jpg);/*图片地址* ...

  3. int a=5,则 ++(a++)的值是?

    编译出错:++(a++)先计算的是括号里的(a++),返回的结果是一个表达式,其值是5,不能对表达式进行赋值

  4. __proto__和protaotype的区分

    直接看这样一个例子. var XXX = function(){}; var p = new XXX(); 可以把上面的例子拆分为如下一个过程: var p={}; //初始化一个对象p p.__pr ...

  5. Cocos2d-JS引入资源

    以图片为例: 创建项目后,把图片放入res文件夹,修改 app.js var HelloWorldLayer = cc.Layer.extend({ sprite:null, ctor:functio ...

  6. 实验 snort安装配置与规则编写

    1 实验目的 在linux或windows任意一个平台下完成snort的安装,使snort工作在NIDS模式下,并编写符合相关情景要求的snort规则. 2 实验环境 物理机:windows 8.1 ...

  7. Linux-modules software

    简介 这里指的modules不是linux内核相关的module,只是用于软件多版本控制的一个开源软件包,比如说系统同时有neo4j的不同版本,使用modules软件就可以使得在需要的时候选择相应的软 ...

  8. LightOj 1090 - Trailing Zeroes (II)---求末尾0的个数

    题目链接:http://lightoj.com/volume_showproblem.php?problem=1090 题意:给你四个数 n, r, p, q 求C(n, r) * p^q的结果中末尾 ...

  9. Essential Documents to Manage Your Projects

    Speak to an experienced project manager, and they can give you a wealth of good advice on the do's a ...

  10. iOS FMDB小试了一下

    今天从早上9点,一直在看FMDB,知道中午11:40.我的效率是不是很低下.中间也碰到了几个小bug. 虽然做了一个小demo,但是觉得还比不上在项目中使用中锻炼的多,先暂且一总结. 先下载FMDB的 ...