postgresql.confの内容ナイヨウ設定セッテイレイ精査中です(習得内容がまだ反映されていません)セイサ チュウです)  
・PostgreSQL9.1.4
・Excelの条件付ジョウケンツ書式ショシキ使ツカってヨコ罫線ケイセンいているため、前後ゼンゴククり(パラメータとコメント説明セツメイククり)がコトなる場合バアイがあります。
トク
重要ジュウヨウ
にA
 初期ショキ提供テイキョウファイル(9.1.4)  内容ナイヨウはインストール方法ホウホウトウによりコトなる  カスタマイズレイ  ソナエ  コウ
    # ----------------------------- # -----------------------------    
T   # PostgreSQL configuration file # PostgreSQL configuration file    
    # ----------------------------- # -----------------------------    
    # #    
    # This file consists of lines of the form: # This file consists of lines of the form:    
    # #    
    #   name = value #   name = value    
    # #    
    # (The "=" is optional.)  Whitespace may be used.  Comments are introduced with # (The "=" is optional.)  Whitespace may be used.  Comments are introduced with    
    # "#" anywhere on a line.  The complete list of parameter names and allowed # "#" anywhere on a line.  The complete list of parameter names and allowed    
    # values can be found in the PostgreSQL documentation. # values can be found in the PostgreSQL documentation.    
    # #    
    # The commented-out settings shown in this file represent the default values. # The commented-out settings shown in this file represent the default values.    
    # Re-commenting a setting is NOT sufficient to revert it to the default value; # Re-commenting a setting is NOT sufficient to revert it to the default value;    
    # you need to reload the server. # you need to reload the server.    
    # #    
    # This file is read on server startup and when the server receives a SIGHUP # This file is read on server startup and when the server receives a SIGHUP    
    # signal.  If you edit the file on a running system, you have to SIGHUP the # signal.  If you edit the file on a running system, you have to SIGHUP the    
    # server for the changes to take effect, or use "pg_ctl reload".  Some # server for the changes to take effect, or use "pg_ctl reload".  Some    
    # parameters, which are marked below, require a server shutdown and restart to # parameters, which are marked below, require a server shutdown and restart to    
    # take effect. # take effect.    
    # #    
    # Any parameter can also be given as a command-line option to the server, e.g., # Any parameter can also be given as a command-line option to the server, e.g.,    
    # "postgres -c log_connections=on".  Some parameters can be changed at run time # "postgres -c log_connections=on".  Some parameters can be changed at run time    
    # with the "SET" SQL command. # with the "SET" SQL command.    
    # #    
    # Memory units:  kB = kilobytes        Time units:  ms  = milliseconds # Memory units:  kB = kilobytes        Time units:  ms  = milliseconds    
    #                MB = megabytes                     s   = seconds #                MB = megabytes                     s   = seconds    
    #                GB = gigabytes                     min = minutes #                GB = gigabytes                     min = minutes    
    #                                                   h   = hours #                                                   h   = hours    
    #                                                   d   = days #                                                   d   = days    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # FILE LOCATIONS # FILE LOCATIONS ファイルの場所        # FILE LOCATIONS  
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
    # The default values of these variables are driven from the -D command-line # The default values of these variables are driven from the -D command-line    
    # option or PGDATA environment variable, represented here as ConfigDir. # option or PGDATA environment variable, represented here as ConfigDir.    
           
p   #data_directory = 'ConfigDir' # use data in another directory #data_directory = 'ConfigDir' # use data in another directory    
    # (change requires restart) # (change requires restart)    
p   #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file    
    # (change requires restart) # (change requires restart)    
p   #ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file #ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file    
    # (change requires restart) # (change requires restart)    
           
    # If external_pid_file is not explicitly set, no extra PID file is written. # If external_pid_file is not explicitly set, no extra PID file is written.    
p   #external_pid_file = '(none)' # write an extra PID file #external_pid_file = '(none)' # write an extra PID file    
    # (change requires restart) # (change requires restart)    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # CONNECTIONS AND AUTHENTICATION # CONNECTIONS AND AUTHENTICATION  接続と認証            # CONNECTIONS AND AUTHENTICATION  
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
T   # - Connection Settings - # - Connection Settings - (1)接続設定              # - Connection Settings -  
           
p A #listen_addresses = 'localhost' # what IP address(es) to listen on; listen_addresses = '*' # what IP address(es) to listen on; ○listen_addresses
リスニングするhostnameやアドレスを設定(左記では仮に「*すべて」としている)
デフォルトのままでは外からの接続は不可。
    # comma-separated list of addresses; # comma-separated list of addresses;    
    # defaults to 'localhost', '*' = all # defaults to 'localhost', '*' = all    
    # (change requires restart) # (change requires restart)    
p A #port = 5432 # (change requires restart) #port = 5432 # (change requires restart) ○port 
サーバガワのリスニングポート
 
p A max_connections = 100 # (change requires restart) max_connections = 110 # (change requires restart) ○max_connections
接続あたり400Bのshared memory 消費
    # Note:  Increasing max_connections costs ~400 bytes of shared memory per # Note:  Increasing max_connections costs ~400 bytes of shared memory per    
    # connection slot, plus lock space (see max_locks_per_transaction). # connection slot, plus lock space (see max_locks_per_transaction).    
p   #superuser_reserved_connections = 3 # (change requires restart) superuser_reserved_connections = 10 # (change requires restart) ○superuser_reserved_connections
PostgreSQLのスーパユーザによる接続のための予約数。
最低でもこれだけの接続ができるという意味でその値以上はスーパユーザによる接続ができないというわけではない。
 
p   #unix_socket_directory = '' # (change requires restart) #unix_socket_directory = '' # (change requires restart)    
p   #unix_socket_group = '' # (change requires restart) #unix_socket_group = '' # (change requires restart)    
p   #unix_socket_permissions = 0777 # begin with 0 to use octal notation #unix_socket_permissions = 0777 # begin with 0 to use octal notation    
    # (change requires restart) # (change requires restart)    
p   #bonjour = off # advertise server via Bonjour #bonjour = off # advertise server via Bonjour    
    # (change requires restart) # (change requires restart)    
p   #bonjour_name = '' # defaults to the computer name #bonjour_name = '' # defaults to the computer name    
    # (change requires restart) # (change requires restart)    
           
T   # - Security and Authentication - # - Security and Authentication - (2) セキュリティと認証          # - Security and Authentication -  
           
p   #authentication_timeout = 1min # 1s-600s #authentication_timeout = 1min # 1s-600s ○authentication_timeout
クライアント認証を完了するまでの最大時間(秒)。
この時間内にクライアントが認証プロトコルを完了しない場合、サーバは接続を閉じる。
ハングしたクライアントが接続を永久に占有することを防ぐためのもの。
 
p   #ssl = off # (change requires restart) #ssl = off # (change requires restart)    
p   #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers    
    # (change requires restart) # (change requires restart)    
p   #ssl_renegotiation_limit = 512MB # amount of data between renegotiations #ssl_renegotiation_limit = 512MB # amount of data between renegotiations    
p   #password_encryption = on #password_encryption = on    
p   #db_user_namespace = off #db_user_namespace = off    
           
    # Kerberos and GSSAPI # Kerberos and GSSAPI    
p   #krb_server_keyfile = '' #krb_server_keyfile = ''    
p   #krb_srvname = 'postgres' # (Kerberos only) #krb_srvname = 'postgres' # (Kerberos only)    
p   #krb_caseins_users = off #krb_caseins_users = off    
           
T   # - TCP Keepalives - # - TCP Keepalives - (3) TCPKeepalive      # - TCP Keepalives -  
    # see "man 7 tcp" for details # see "man 7 tcp" for details    
           
p   #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;    
    # 0 selects the system default # 0 selects the system default    
p   #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;    
    # 0 selects the system default # 0 selects the system default    
p   #tcp_keepalives_count = 0 # TCP_KEEPCNT; #tcp_keepalives_count = 0 # TCP_KEEPCNT;    
    # 0 selects the system default # 0 selects the system default    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # RESOURCE USAGE (except WAL) # RESOURCE USAGE (except WAL) 4.資源の消費             # RESOURCE USAGE (except WAL)  
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
T   # - Memory - # - Memory - (1)メモリ                         # - Memory -  
           
p   shared_buffers = 32MB # min 128kB shared_buffers = 512MB # min 128kB ○shared_buffers
最初は物理メモリの25%を目安として設定する。
データベースサーバが使用する共有メモリバッファのために使用するメモリ量。
OSキャッシュも使用を想定した作りになっており、40%以上では効果は見込めない。
大きくする場合、checkpoint_segmentsも考慮のこと。
 
    # (change requires restart) # (change requires restart)    
p   #temp_buffers = 8MB # min 800kB #temp_buffers = 8MB # min 800kB ○temp_buffers
一時テーブル用のメモリー
CREATE TEMP TABLEが使用される場合のみに使われるものでソート処理などとは無関係(のはず)
それぞれのセッション内で変更可能※なので、むやみに大きくせず必要なセッション単位で指定させること。
※ ただしのセッション内で一時テーブルが最初に使用された後は、再び変更してもセッション内では変更は反映されない。
 
p   #max_prepared_transactions = 0 # zero disables the feature #max_prepared_transactions = 0 # zero disables the feature    
    # (change requires restart) # (change requires restart)    
    # Note:  Increasing max_prepared_transactions costs ~600 bytes of shared memory # Note:  Increasing max_prepared_transactions costs ~600 bytes of shared memory    
    # per transaction slot, plus lock space (see max_locks_per_transaction). # per transaction slot, plus lock space (see max_locks_per_transaction).    
    # It is not advisable to set max_prepared_transactions nonzero unless you # It is not advisable to set max_prepared_transactions nonzero unless you    
    # actively intend to use prepared transactions. # actively intend to use prepared transactions.    
p   #work_mem = 1MB # min 64kB work_mem = 4MB # min 64kB ○work_mem
 
ソートやハッシュなどに使用するメモリサイズ
・ソート(並び替え操作)・・・ORDER BY、DISTINCT、およびマージ結合
・ハッシュテーブル・・・ハッシュ結合、ハッシュに基づいた集約、およびIN副問い合わせのハッシュに基づいた処理

・複雑な問い合わせなどこの値がそれぞれに発生する。(はず)
全体ゼンタイのメモリリョウ設定セッテイではないため、使用されるメモリの合計は、work_memのnバイ

【参考】メモリー内でのソートで収まっているかの確認「EXPLAIN ANALYZE」コマンド
test=# EXPLAIN ANALYZE SELECT * FROM pgbench_accounts ORDER BY abalance LIMIT 10;
・・・
Sort Method: top-N heapsort Memory★: 18kB

test=# EXPLAIN ANALYZE SELECT * FROM pgbench_accounts ORDER BY abalance;
・・・
Sort Method: external sort Disk★: 10456kB

 
p   #maintenance_work_mem = 16MB # min 1MB maintenance_work_mem = 64MB # min 1MB ○maintenance_work_mem

保守操作で使用されるメモリの最大容量
・VACUUM
・CREATE INDEX
・ALTER TABLE ADD FOREIGN KEYなど
オートバキュームの最大autovacuum_max_workers倍の確保があることに注意。
 
p   #max_stack_depth = 2MB # min 100kB #max_stack_depth = 2MB # min 100kB    
           
T   # - Kernel Resource Usage - # - Kernel Resource Usage - (2)カーネル資源使用                  # - Kernel Resource Usage -  
           
p   #max_files_per_process = 1000 # min 25 #max_files_per_process = 1000 # min 25    
    # (change requires restart) # (change requires restart)    
p   #shared_preload_libraries = '' # (change requires restart) #shared_preload_libraries = '' # (change requires restart) ・shared_preload_libraries
事前読み込みする共有ライブラリ名(コンマ区切り複数指定可)

 
           
T   # - Cost-Based Vacuum Delay - # - Cost-Based Vacuum Delay - (3)コストに基づくVacuum遅延         # - Kernel Resource Usage -  
        VACUUM および ANALYZE コマンドの実行中、実行される各種I/O操作の予測コストを追跡し続ける内部カウンタをシステムが保守します。
累積されたコストが(vacuum_cost_limitで指定された)限度に達すると、
操作を実行しているプロセスはvacuum_cost_delayで指定されたちょっとの間スリープします。
その後、カウンタをリセットし、実行を継続します。
この機能の目的は、同時実行的データベース活動上のこれらコマンドのI/Oに対する影響を管理者から軽減させます。
VACUUM および ANALYZEの様な保守用コマンドが即座に終了することが重要ではない事態が数多くあります。
 しかし、他のデータベースの操作を行うに当たって、これらのコマンドがシステムの能力に多大な阻害を与えないことは通常とても重要です。コストに基づいたvacuum遅延はこれを実現するための方法を管理者に提供します。
手動でVACUUMコマンドを実行することができるように、デフォルトでこの機能は無効になっています。
有効にするには、vacuum_cost_delay変数をゼロでない値に設定します。
 
p   #vacuum_cost_delay = 0ms # 0-100 milliseconds #vacuum_cost_delay = 0ms # 0-100 milliseconds    
p   #vacuum_cost_page_hit = 1 # 0-10000 credits #vacuum_cost_page_hit = 1 # 0-10000 credits    
p   #vacuum_cost_page_miss = 10 # 0-10000 credits #vacuum_cost_page_miss = 10 # 0-10000 credits    
p   #vacuum_cost_page_dirty = 20 # 0-10000 credits #vacuum_cost_page_dirty = 20 # 0-10000 credits    
p   #vacuum_cost_limit = 200 # 1-10000 credits #vacuum_cost_limit = 200 # 1-10000 credits    
           
T   # - Background Writer - # - Background Writer - (4)バックグラウンドライタ         # -  Background Writer -  
           
p   #bgwriter_delay = 200ms # 10-10000ms between rounds #bgwriter_delay = 200ms # 10-10000ms between rounds    
p   #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round    
p   #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round    
           
T   # - Asynchronous Behavior - # - Asynchronous Behavior - (5)非同期動作                     # - Asynchronous Behavior -  
           
p   #effective_io_concurrency = 1 # 1-1000. 0 disables prefetching #effective_io_concurrency = 1 # 1-1000. 0 disables prefetching    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # WRITE AHEAD LOG # WRITE AHEAD LOG 5. ログ先行書き込み(WAL)   # WRITE AHEAD LOG  
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
T   # - Settings - # - Settings - (1)諸設定                         #- Settings   
           
p A #wal_level = minimal # minimal, archive, or hot_standby wal_level = archive # minimal, archive, or hot_standby ○wal_level

WALに書かれる情報のレベル。

・minimal(デフォルト)クラッシュまたは即時停止から回復するのに必要な情報のみ。
・archive              WALアーカイビングに必要なロギングを追加。
・hot_standby          更にスタンバイサーバ上の読み取り専用問い合わせの情報を追加。


minimalで省略されるもの(項14.4.7を参照してください)。

CREATE TABLE AS
CREATE INDEX
CLUSTER
同一トランザクション内で作成されたか、もしくは切り詰められたテーブルに対するCOPY

minimalではベースバックアップとWALログからデータを再構築できない。★重要
WALアーカイビング(archive_mode)はarchiveが必須
 
    # (change requires restart) # (change requires restart)    
p   #fsync = on # turns forced synchronization on or off #fsync = on # turns forced synchronization on or off    
p   #synchronous_commit = on # synchronization level; on, off, or local #synchronous_commit = on # synchronization level; on, off, or local    
p   #wal_sync_method = fsync # the default is the first option #wal_sync_method = fsync # the default is the first option    
    # supported by the operating system: # supported by the operating system:    
    #   open_datasync #   open_datasync    
    #   fdatasync (default on Linux) #   fdatasync (default on Linux)    
    #   fsync #   fsync    
    #   fsync_writethrough #   fsync_writethrough    
    #   open_sync #   open_sync    
p   #full_page_writes = on # recover from partial page writes #full_page_writes = on # recover from partial page writes    
p   #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers ○wal_buffers

WALデータ用バッファ。
-1(デフォルト)はshared_buffersの1/32(約3%)
数MBあればコミット負荷の高いシステムでも問題ないとされる。通常はこのままでよい。


・その他、このカテゴリでonになっているところはリカバリに影響するため基本的に変えてはいけない。

 
    # (change requires restart) # (change requires restart)    
p   #wal_writer_delay = 200ms # 1-10000 milliseconds #wal_writer_delay = 200ms # 1-10000 milliseconds    
           
p   #commit_delay = 0 # range 0-100000, in microseconds #commit_delay = 0 # range 0-100000, in microseconds    
p   #commit_siblings = 5 # range 1-1000 #commit_siblings = 5 # range 1-1000    
           
T   # - Checkpoints - # - Checkpoints - (2)チェックポイント                         # - Checkpoints -  
           
p   #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each ○checkpoint_segments

自動WALチェックポイント間の最大ログファイル数。(各16MB)
デフォルトは3セグメント。
このパラメータを増やすと、クラッシュリカバリで必要となる時間が増加します。
 
p   #checkpoint_timeout = 5min # range 30s-1h #checkpoint_timeout = 5min # range 30s-1h    
p   #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0    
p   #checkpoint_warning = 30s # 0 disables #checkpoint_warning = 30s # 0 disables    
           
T   # - Archiving - # - Archiving - (3)アーカイビング                         # - Archiving -  
           
p   #archive_mode = off # allows archiving to be done #archive_mode = off # allows archiving to be done ○archive_mode

on
off
wal_level が minimalの場合はarchive_modeは有効にならないので注意。
 
    # (change requires restart) # (change requires restart)    
p   #archive_command = '' # command to use to archive a logfile segment archive_command = '' ○archive_command

archive_mode=onで起動しないと設定は無視される。
archive_mode=onでarchive_command=''だとWALセグメントの蓄積を続けます。

/bin/trueのように、archive_commandに真を返す設定にすると
アーカイブモードであっても蓄積をしないようにすることができる。
(特別な場合のみ)

 
      #archive_command = '/bin/true' ★重要 archive_command は/bin/trueではスルーするだけなのであくまで検証環境用。  
p   #archive_timeout = 0 # force a logfile segment switch after this #archive_timeout = 0 # force a logfile segment switch after this    
    # number of seconds; 0 disables # number of seconds; 0 disables    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # REPLICATION # REPLICATION 6. レプリケーション     # REPLICATION  
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
T   # - Master Server - # - Master Server - (1)マスターサーバ       # - Master Server -  
           
    # These settings are ignored on a standby server # These settings are ignored on a standby server    
           
p   #max_wal_senders = 0 # max number of walsender processes #max_wal_senders = 0 # max number of walsender processes    
    # (change requires restart) # (change requires restart)    
p   #wal_sender_delay = 1s # walsender cycle time, 1-10000 milliseconds #wal_sender_delay = 1s # walsender cycle time, 1-10000 milliseconds    
p   #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables    
p   #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed    
p   #replication_timeout = 60s # in milliseconds; 0 disables #replication_timeout = 60s # in milliseconds; 0 disables    
p   #synchronous_standby_names = '' # standby servers that provide sync rep #synchronous_standby_names = '' # standby servers that provide sync rep    
    # comma-separated list of application_name # comma-separated list of application_name    
p   # from standby(s); '*' = all # from standby(s); '*' = all    
           
T   # - Standby Servers - # - Standby Servers - (2)スタンバイサーバ         # - Standby Servers -  
           
    # These settings are ignored on a master server # These settings are ignored on a master server    
           
p   #hot_standby = off # "on" allows queries during recovery #hot_standby = off # "on" allows queries during recovery    
    # (change requires restart) # (change requires restart)    
p   #max_standby_archive_delay = 30s # max delay before canceling queries #max_standby_archive_delay = 30s # max delay before canceling queries    
    # when reading WAL from archive; # when reading WAL from archive;    
    # -1 allows indefinite delay # -1 allows indefinite delay    
p   #max_standby_streaming_delay = 30s # max delay before canceling queries #max_standby_streaming_delay = 30s # max delay before canceling queries    
    # when reading streaming WAL; # when reading streaming WAL;    
    # -1 allows indefinite delay # -1 allows indefinite delay    
p   #wal_receiver_status_interval = 10s # send replies at least this often #wal_receiver_status_interval = 10s # send replies at least this often    
    # 0 disables # 0 disables    
p   #hot_standby_feedback = off # send info from standby to prevent #hot_standby_feedback = off # send info from standby to prevent    
    # query conflicts # query conflicts    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # QUERY TUNING # QUERY TUNING 7. 問い合わせ計画     # QUERY TUNING  
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
T   # - Planner Method Configuration - # - Planner Method Configuration - (1) プランナメソッド設定  
           
p   #enable_bitmapscan = on #enable_bitmapscan = on    
p   #enable_hashagg = on #enable_hashagg = on    
p   #enable_hashjoin = on #enable_hashjoin = on    
p   #enable_indexscan = on #enable_indexscan = on    
p   #enable_material = on #enable_material = on    
p   #enable_mergejoin = on #enable_mergejoin = on    
p   #enable_nestloop = on #enable_nestloop = on    
p   #enable_seqscan = on #enable_seqscan = on    
p   #enable_sort = on #enable_sort = on    
p   #enable_tidscan = on #enable_tidscan = on    
           
T   # - Planner Cost Constants - # - Planner Cost Constants - (2) プランナコスト定数    # - Planner Cost Constants -  
           
p   #seq_page_cost = 1.0 # measured on an arbitrary scale #seq_page_cost = 1.0 # measured on an arbitrary scale    
p   #random_page_cost = 4.0 # same scale as above #random_page_cost = 4.0 # same scale as above    
p   #cpu_tuple_cost = 0.01 # same scale as above #cpu_tuple_cost = 0.01 # same scale as above    
p   #cpu_index_tuple_cost = 0.005 # same scale as above #cpu_index_tuple_cost = 0.005 # same scale as above    
p   #cpu_operator_cost = 0.0025 # same scale as above #cpu_operator_cost = 0.0025 # same scale as above    
p   #effective_cache_size = 128MB #effective_cache_size = 128MB    
           
T   # - Genetic Query Optimizer - # - Genetic Query Optimizer - (3) 遺伝的問い合わせオプティマイザ # - Genetic Query Optimizer -  
           
p   #geqo = on #geqo = on    
p   #geqo_threshold = 12 #geqo_threshold = 12    
p   #geqo_effort = 5 # range 1-10 #geqo_effort = 5 # range 1-10    
p   #geqo_pool_size = 0 # selects default based on effort #geqo_pool_size = 0 # selects default based on effort    
p   #geqo_generations = 0 # selects default based on effort #geqo_generations = 0 # selects default based on effort    
p   #geqo_selection_bias = 2.0 # range 1.5-2.0 #geqo_selection_bias = 2.0 # range 1.5-2.0    
p   #geqo_seed = 0.0 # range 0.0-1.0 #geqo_seed = 0.0 # range 0.0-1.0    
           
T   # - Other Planner Options - # - Other Planner Options - (4) その他のプランナオプション    # - Other Planner Options -  
           
p   #default_statistics_target = 100 # range 1-10000 #default_statistics_target = 100 # range 1-10000    
p   #constraint_exclusion = partition # on, off, or partition #constraint_exclusion = partition # on, off, or partition    
p   #cursor_tuple_fraction = 0.1 # range 0.0-1.0 #cursor_tuple_fraction = 0.1 # range 0.0-1.0    
p   #from_collapse_limit = 8 #from_collapse_limit = 8    
p   #join_collapse_limit = 8 # 1 disables collapsing of explicit #join_collapse_limit = 8 # 1 disables collapsing of explicit    
    # JOIN clauses # JOIN clauses    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # ERROR REPORTING AND LOGGING # ERROR REPORTING AND LOGGING 8. エラー報告とログ取得   # ERROR REPORTING AND LOGGING  
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
T   # - Where to Log - # - Where to Log - (1) ログの出力先        # - Where to Log -  
           
p A #log_destination = 'stderr' # Valid values are combinations of #log_destination = 'stderr' # Valid values are combinations of ○log_destination  サーバログの出力先

stderr  平文で標準エラーへ
csvlog  csvで標準エラーへ(logging_collector=onが必要)
syslog  シスログへ(syslog側の設定も必要)
 
    # stderr, csvlog, syslog, and eventlog, # stderr, csvlog, syslog, and eventlog,    
    # depending on platform.  csvlog # depending on platform.  csvlog    
    # requires logging_collector to be on. # requires logging_collector to be on.    
           
    # This is used when logging to stderr: # This is used when logging to stderr:    
p A #logging_collector = off # Enable capturing of stderr and csvlog logging_collector = on ○logging_collector
onでファイルにリダイレクトする。
 
    # into log files. Required to be on for # into log files. Required to be on for    
    # csvlogs. # csvlogs.    
    # (change requires restart) # (change requires restart)    
           
    # These are only used if logging_collector is on: # These are only used if logging_collector is on:    
p A #log_directory = 'pg_log' # directory where log files are written, #log_directory = 'pg_log' # directory where log files are written, ○log_directory

リダイレクト先のディレクトリ
 
    # can be absolute or relative to PGDATA # can be absolute or relative to PGDATA    
p A log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, ○log_filename

同ファイル名
 
p   # can include strftime() escapes # can include strftime() escapes    
p   #log_file_mode = 0600 # creation mode for log files, #log_file_mode = 0600 # creation mode for log files,    
    # begin with 0 to use octal notation # begin with 0 to use octal notation    
p   #log_truncate_on_rotation = off # If on, an existing log file with the #log_truncate_on_rotation = off # If on, an existing log file with the ○log_truncate_on_rotation

指定期間が経過して上書きするかどうか
 
    # same name as the new log file will be # same name as the new log file will be    
    # truncated rather than appended to. # truncated rather than appended to.    
    # But such truncation only occurs on # But such truncation only occurs on    
    # time-driven rotation, not on restarts # time-driven rotation, not on restarts    
    # or size-driven rotation.  Default is # or size-driven rotation.  Default is    
    # off, meaning append to existing files # off, meaning append to existing files    
    # in all cases. # in all cases.    
p   #log_rotation_age = 1d # Automatic rotation of logfiles will #log_rotation_age = 1d # Automatic rotation of logfiles will ○log_rotation_age
1個のログファイルの期間(次に変わるまでの期間)
 
    # happen after that time.  0 disables. # happen after that time.  0 disables.    
p   #log_rotation_size = 10MB # Automatic rotation of logfiles will log_rotation_size = 0 このサイズになったらファイルを分割する  
    # happen after that much log output. # happen after that much log output.    
    # 0 disables. # 0 disables.    
           
    # These are relevant when logging to syslog: # These are relevant when logging to syslog:    
p   #syslog_facility = 'LOCAL0' #syslog_facility = 'LOCAL0'    
p   #syslog_ident = 'postgres' #syslog_ident = 'postgres'    
           
p   #silent_mode = off # Run server silently. #silent_mode = off # Run server silently.    
    # DO NOT USE without syslog or # DO NOT USE without syslog or    
    # logging_collector # logging_collector    
    # (change requires restart) # (change requires restart)    
           
           
T   # - When to Log - # - When to Log - (2) いつログを取得するか     # - When to Log -  
           
p   #client_min_messages = notice # values in order of decreasing detail: #client_min_messages = notice # values in order of decreasing detail: ○client_min_messages
 
    #   debug5 #   debug5    
    #   debug4 #   debug4    
    #   debug3 #   debug3    
    #   debug2 #   debug2    
    #   debug1 #   debug1    
    #   log #   log    
    #   notice #   notice    
    #   warning #   warning    
    #   error #   error    
           
p A #log_min_messages = warning # values in order of decreasing detail: #log_min_messages = warning # values in order of decreasing detail: ○log_min_messages = warning

どのメッセージ階層をサーバログに書き込むかを管理します。有効な値は DEBUG5、DEBUG4、 DEBUG3、DEBUG2、DEBUG1、 INFO、NOTICE、WARNING、 ERROR、LOG、FATAL、および PANICです。それぞれの階層はその下の全ての階層を含みます。階層を低くする程、より少ないメッセージがログに送られます。デフォルトはWARNINGです。ここでのLOGの優先順位がclient_min_messagesの場合と異なることに注意してください。スーパユーザのみこの設定を変更できます。
 
    #   debug5 #   debug5    
    #   debug4 #   debug4    
    #   debug3 #   debug3    
    #   debug2 #   debug2    
    #   debug1 #   debug1    
    #   info #   info    
    #   notice #   notice    
    #   warning #   warning    
    #   error #   error    
    #   log #   log    
    #   fatal #   fatal    
    #   panic #   panic    
           
p   #log_min_error_statement = error # values in order of decreasing detail: #log_min_error_statement = error # values in order of decreasing detail: ○log_min_error_statement (enum)
エラー条件の原因となったどのSQL文をサーバログに記録するかを制御します。設定したレベル以上のメッセージについては現在のSQL文がログに記録されます。有効な値は、DEBUG5、DEBUG4、DEBUG3、DEBUG2、DEBUG1、INFO、NOTICE、WARNING、ERROR、LOG、FATAL、PANICです。デフォルトはERRORです。エラー、ログメッセージ、致命的エラー、パニックを引き起こした文がログに記録されることを意味します。失敗した文の記録を実質的に無効にするには、このパラメータをPANICに設定してください。スーパーユーザのみがこのオプションを変更することができます。
 
    #   debug5 #   debug5    
    #   debug4 #   debug4    
    #   debug3 #   debug3    
    #   debug2 #   debug2    
    #   debug1 #   debug1    
    #   info #   info    
    #   notice #   notice    
    #   warning #   warning    
    #   error #   error    
    #   log #   log    
    #   fatal #   fatal    
    #   panic (effectively off) #   panic (effectively off)    
           
p   #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements log_min_duration_statement = 1ms ○log_min_duration_statement (integer)
文の実行に少なくとも指定したミリ秒数かかった場合、それぞれの文の実行に要した時間をログに記録します。 0に設定すれば、すべての文の実行時間が出力されます。 -1(デフォルト)は、文実行時間の記録を無効にします。例えば、250msと設定した場合、250msもしくはそれ以上長くかかった全てのSQL文がログとして残ります。このパラメータを有効にすることにより、アプリケーションで最適化されていない問い合わせを追跡するのが便利になります。スーパーユーザのみこの設定を変更できます。

拡張問い合わせプロトコルを使用するクライアントでは、Parse、Bind、Executeそれぞれの段階で要した時間が独立して記録されます。

注意: このオプションとlog_statementを一緒に使用する時、log_statementによってログされるテキスト文は、実行時間のログには重複されません。 syslogを使用していなければ、プロセスIDとセッションIDを使用して、文メッセージと後の実行時間メッセージを関連付けできるように、log_line_prefixを使用してPIDまたはセッションIDをログに記録することを勧めます。 ★要確認
 
p   # and their durations, > 0 logs only # and their durations, > 0 logs only    
    # statements running at least this number # statements running at least this number    
    # of milliseconds # of milliseconds    
           
           
T   # - What to Log - # - What to Log - (3)何をログに  
           
p   #debug_print_parse = off #debug_print_parse = off    
p   #debug_print_rewritten = off #debug_print_rewritten = off    
p   #debug_print_plan = off #debug_print_plan = off    
p   #debug_pretty_print = on #debug_pretty_print = on    
p   #log_checkpoints = off #log_checkpoints = off    
p   #log_connections = off #log_connections = off    
p   #log_disconnections = off #log_disconnections = off    
p   #log_duration = off #log_duration = off    
p   #log_error_verbosity = default # terse, default, or verbose messages #log_error_verbosity = default # terse, default, or verbose messages    
p   #log_hostname = off #log_hostname = off    
p A #log_line_prefix = '' # special values: log_line_prefix = '%t [%d](%p)'    
    #   %a = application name #   %a = application name    
    #   %u = user name #   %u = user name    
    #   %d = database name #   %d = database name    
    #   %r = remote host and port #   %r = remote host and port    
    #   %h = remote host #   %h = remote host    
    #   %p = process ID #   %p = process ID    
    #   %t = timestamp without milliseconds #   %t = timestamp without milliseconds    
    #   %m = timestamp with milliseconds #   %m = timestamp with milliseconds    
    #   %i = command tag #   %i = command tag    
    #   %e = SQL state #   %e = SQL state    
    #   %c = session ID #   %c = session ID    
    #   %l = session line number #   %l = session line number    
    #   %s = session start timestamp #   %s = session start timestamp    
    #   %v = virtual transaction ID #   %v = virtual transaction ID    
    #   %x = transaction ID (0 if none) #   %x = transaction ID (0 if none)    
    #   %q = stop here in non-session #   %q = stop here in non-session    
    #        processes #        processes    
    #   %% = '%' #   %% = '%'    
    # e.g. '<%u%%%d> ' # e.g. '<%u%%%d> '    
p   #log_lock_waits = off # log lock waits >= deadlock_timeout #log_lock_waits = off # log lock waits >= deadlock_timeout    
p   #log_statement = 'none' # none, ddl, mod, all log_statement = 'all' # none, ddl, mod, all    
p   #log_temp_files = -1 # log temporary files equal or larger #log_temp_files = -1 # log temporary files equal or larger    
    # than the specified size in kilobytes; # than the specified size in kilobytes;    
    # -1 disables, 0 logs all temp files # -1 disables, 0 logs all temp files    
p   #log_timezone = '(defaults to server environment setting)' #log_timezone = '(defaults to server environment setting)'    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # RUNTIME STATISTICS # RUNTIME STATISTICS    
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
T   # - Query/Index Statistics Collector - # - Query/Index Statistics Collector -    
           
p   #track_activities = on #track_activities = on    
p   #track_counts = on #track_counts = on    
p   #track_functions = none # none, pl, all track_functions = all  # none, pl, all ユーザ定義関数の使用状況追跡をする。(実行ジッコウ時間ジカントウ  
p   #track_activity_query_size = 1024 # (change requires restart) #track_activity_query_size = 1024 # (change requires restart)    
p   #update_process_title = on #update_process_title = on    
p   #stats_temp_directory = 'pg_stat_tmp' #stats_temp_directory = 'pg_stat_tmp'    
           
           
T   # - Statistics Monitoring - # - Statistics Monitoring -    
           
p   #log_parser_stats = off #log_parser_stats = off    
p   #log_planner_stats = off #log_planner_stats = off    
p   #log_executor_stats = off #log_executor_stats = off    
p   #log_statement_stats = off #log_statement_stats = off    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # AUTOVACUUM PARAMETERS # AUTOVACUUM PARAMETERS    
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
p   #autovacuum = on # Enable autovacuum subprocess?  'on' #autovacuum = on # Enable autovacuum subprocess?  'on'    
    # requires track_counts to also be on. # requires track_counts to also be on.    
p   #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and log_autovacuum_min_duration = 0 # -1 disables, 0 logs all actions and    
    # their durations, > 0 logs only # their durations, > 0 logs only    
    # actions running at least this number # actions running at least this number    
    # of milliseconds. # of milliseconds.    
p   #autovacuum_max_workers = 3 # max number of autovacuum subprocesses #autovacuum_max_workers = 3 # max number of autovacuum subprocesses    
    # (change requires restart) # (change requires restart)    
p   #autovacuum_naptime = 1min # time between autovacuum runs #autovacuum_naptime = 1min # time between autovacuum runs    
p   #autovacuum_vacuum_threshold = 50 # min number of row updates before #autovacuum_vacuum_threshold = 50 # min number of row updates before    
    # vacuum # vacuum    
p   #autovacuum_analyze_threshold = 50 # min number of row updates before #autovacuum_analyze_threshold = 50 # min number of row updates before    
    # analyze # analyze    
p   #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum    
p   #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze    
p   #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum    
    # (change requires restart) # (change requires restart)    
p   #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for    
    # autovacuum, in milliseconds; # autovacuum, in milliseconds;    
    # -1 means use vacuum_cost_delay # -1 means use vacuum_cost_delay    
p   #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for    
    # autovacuum, -1 means use # autovacuum, -1 means use    
    # vacuum_cost_limit # vacuum_cost_limit    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # CLIENT CONNECTION DEFAULTS # CLIENT CONNECTION DEFAULTS    
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
T   # - Statement Behavior - # - Statement Behavior -    
           
p A #search_path = '"$user",public' # schema names #search_path = '"$user",public' # schema names    
p   #default_tablespace = '' # a tablespace name, '' uses the default #default_tablespace = '' # a tablespace name, '' uses the default    
p   #temp_tablespaces = '' # a list of tablespace names, '' uses #temp_tablespaces = '' # a list of tablespace names, '' uses    
    # only default tablespace # only default tablespace    
p   #check_function_bodies = on #check_function_bodies = on    
p   #default_transaction_isolation = 'read committed' #default_transaction_isolation = 'read committed'    
p   #default_transaction_read_only = off #default_transaction_read_only = off    
p   #default_transaction_deferrable = off #default_transaction_deferrable = off    
p   #session_replication_role = 'origin' #session_replication_role = 'origin'    
p   #statement_timeout = 0 # in milliseconds, 0 is disabled #statement_timeout = 0 # in milliseconds, 0 is disabled    
p   #vacuum_freeze_min_age = 50000000 #vacuum_freeze_min_age = 50000000    
p   #vacuum_freeze_table_age = 150000000 #vacuum_freeze_table_age = 150000000    
p   #bytea_output = 'hex' # hex, escape #bytea_output = 'hex' # hex, escape    
p   #xmlbinary = 'base64' #xmlbinary = 'base64'    
p   #xmloption = 'content' #xmloption = 'content'    
           
T   # - Locale and Formatting - # - Locale and Formatting -    
           
p   datestyle = 'iso, mdy' datestyle = 'iso, mdy'    
p   #intervalstyle = 'postgres' #intervalstyle = 'postgres'    
p   #timezone = '(defaults to server environment setting)' #timezone = '(defaults to server environment setting)'    
p   #timezone_abbreviations = 'Default'     # Select the set of available time zone #timezone_abbreviations = 'Default'     # Select the set of available time zone    
    # abbreviations.  Currently, there are # abbreviations.  Currently, there are    
    #   Default #   Default    
    #   Australia #   Australia    
    #   India #   India    
    # You can create your own file in # You can create your own file in    
    # share/timezonesets/. # share/timezonesets/.    
p   #extra_float_digits = 0 # min -15, max 3 #extra_float_digits = 0 # min -15, max 3    
p A #client_encoding = sql_ascii # actually, defaults to database #client_encoding = sql_ascii # actually, defaults to database    
    # encoding # encoding    
           
    # These settings are initialized by initdb, but they can be changed. # These settings are initialized by initdb, but they can be changed.    
p   lc_messages = 'C' # locale for system error message lc_messages = 'C' # locale for system error message    
    # strings # strings    
p   lc_monetary = 'C' # locale for monetary formatting lc_monetary = 'C' # locale for monetary formatting    
p   lc_numeric = 'C' # locale for number formatting lc_numeric = 'C' # locale for number formatting    
p   lc_time = 'C' # locale for time formatting lc_time = 'C' # locale for time formatting    
           
    # default configuration for text search # default configuration for text search    
p   default_text_search_config = 'pg_catalog.english' default_text_search_config = 'pg_catalog.english'    
           
T   # - Other Defaults - # - Other Defaults -    
           
p   #dynamic_library_path = '$libdir' #dynamic_library_path = '$libdir'    
p   #local_preload_libraries = '' #local_preload_libraries = ''    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # LOCK MANAGEMENT # LOCK MANAGEMENT    
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
p   #deadlock_timeout = 1s #deadlock_timeout = 1s    
p   #max_locks_per_transaction = 64 # min 10 #max_locks_per_transaction = 64 # min 10    
    # (change requires restart) # (change requires restart)    
    # Note:  Each lock table slot uses ~270 bytes of shared memory, and there are # Note:  Each lock table slot uses ~270 bytes of shared memory, and there are    
    # max_locks_per_transaction * (max_connections + max_prepared_transactions) # max_locks_per_transaction * (max_connections + max_prepared_transactions)    
    # lock table slots. # lock table slots.    
p   #max_pred_locks_per_transaction = 64 # min 10 #max_pred_locks_per_transaction = 64 # min 10    
    # (change requires restart) # (change requires restart)    
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # VERSION/PLATFORM COMPATIBILITY # VERSION/PLATFORM COMPATIBILITY    
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
T   # - Previous PostgreSQL Versions - # - Previous PostgreSQL Versions -    
           
p   #array_nulls = on #array_nulls = on    
p   #backslash_quote = safe_encoding # on, off, or safe_encoding #backslash_quote = safe_encoding # on, off, or safe_encoding    
p   #default_with_oids = off #default_with_oids = off    
p   #escape_string_warning = on #escape_string_warning = on    
p   #lo_compat_privileges = off #lo_compat_privileges = off    
p   #quote_all_identifiers = off #quote_all_identifiers = off    
p   #sql_inheritance = on #sql_inheritance = on    
p   #standard_conforming_strings = on #standard_conforming_strings = on    
p   #synchronize_seqscans = on #synchronize_seqscans = on    
           
T   # - Other Platforms and Clients - # - Other Platforms and Clients -    
           
p   #transform_null_equals = off #transform_null_equals = off    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # ERROR HANDLING # ERROR HANDLING    
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
p   #exit_on_error = off # terminate session on any error? #exit_on_error = off # terminate session on any error?    
p   #restart_after_crash = on # reinitialize after backend crash? #restart_after_crash = on # reinitialize after backend crash?    
           
           
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
T   # CUSTOMIZED OPTIONS # CUSTOMIZED OPTIONS    
    #------------------------------------------------------------------------------ #------------------------------------------------------------------------------    
           
p   #custom_variable_classes = '' # list of custom variable class names #custom_variable_classes = '' # list of custom variable class names    
           
inserted by FC2 system