# # ----------------------------- # PostgreSQL configuration file # ----------------------------- # # This file consists of lines of the form: # # name = value # # (The "=" is optional.) Whitespace may be used. Comments are introduced with # "#" anywhere on a line. The complete list of parameter names and allowed # values can be found in the PostgreSQL documentation. # # 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; # you need to reload the server. # # 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 # 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 # take effect. # # 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 # with the "SET" SQL command. # # Memory units: kB = kilobytes Time units: ms = milliseconds # MB = megabytes s = seconds # GB = gigabytes min = minutes # h = hours # d = days #------------------------------------------------------------------------------ # FILE LOCATIONS #------------------------------------------------------------------------------ data_directory = '/var/lib/pgsql/10/data' hba_file = '/var/lib/pgsql/10/data/pg_hba.conf' ident_file = '/var/lib/pgsql/10/data/pg_ident.conf' external_pid_file = '/var/run/10-data.pid' #------------------------------------------------------------------------------ # CONNECTIONS AND AUTHENTICATION #------------------------------------------------------------------------------ listen_addresses = '*' port = 5432 max_connections = 100 superuser_reserved_connections = 3 #unix_socket_directories = '/tmp' #unix_socket_group = '' #unix_socket_permissions = 0777 bonjour = off bonjour_name = '' # - Security and Authentication - authentication_timeout = 60s ssl = on ssl_ciphers = 'DEFAULT:!LOW:!EXP:!MD5:@STRENGTH:!RC4' #ssl_renegotiation_limit = 512MB ssl_cert_file = '/var/lib/pgsql/ssl/server.leaf.crt' ssl_key_file = '/var/lib/pgsql/ssl/server.leaf.key' ssl_ca_file = '' ssl_crl_file = '' password_encryption = on db_user_namespace = off # Kerberos and GSSAPI krb_server_keyfile = '' krb_caseins_users = off # TCP Keepalives, 0 selects the system default tcp_keepalives_idle = 0 tcp_keepalives_interval = 0 tcp_keepalives_count = 0 #------------------------------------------------------------------------------ # RESOURCE USAGE (except WAL) #------------------------------------------------------------------------------ # - Memory - shared_buffers = 24MB temp_buffers = 8MB max_prepared_transactions = 0 work_mem = 1MB maintenance_work_mem = 16MB max_stack_depth = 2MB # - Disk - temp_file_limit = -1 # - Kernel Resource Usage - max_files_per_process = 1000 shared_preload_libraries = '' # - Cost-Based Vacuum Delay - vacuum_cost_delay = 0 vacuum_cost_page_hit = 1 vacuum_cost_page_miss = 10 vacuum_cost_page_dirty = 20 vacuum_cost_limit = 200 # - Background Writer - bgwriter_delay = 200ms bgwriter_lru_maxpages = 100 bgwriter_lru_multiplier = 2.0 # - Asynchronous Behavior - effective_io_concurrency = 1 #------------------------------------------------------------------------------ # WRITE AHEAD LOG #------------------------------------------------------------------------------ # - Settings - wal_level = replica fsync = on synchronous_commit = on wal_sync_method = fsync full_page_writes = on wal_buffers = -1 wal_writer_delay = 200ms commit_delay = 0 commit_siblings = 5 # - Checkpoints - #checkpoint_segments = 3 checkpoint_timeout = 5min checkpoint_completion_target = 0.5 checkpoint_warning = 30s # - Archiving - archive_mode = off archive_command = '' archive_timeout = 0 #------------------------------------------------------------------------------ # REPLICATION #------------------------------------------------------------------------------ # - Sending Server(s) - max_wal_senders = 0 wal_keep_segments = 0 wal_sender_timeout = 60s # - Master Server - synchronous_standby_names = '' vacuum_defer_cleanup_age = 0 # - Standby Servers - hot_standby = off max_standby_archive_delay = 30s max_standby_streaming_delay = 30s wal_receiver_status_interval = 10s hot_standby_feedback = on wal_receiver_timeout = 60s #------------------------------------------------------------------------------ # QUERY TUNING #------------------------------------------------------------------------------ # - Planner Method Configuration - enable_bitmapscan = on enable_hashagg = on enable_hashjoin = on enable_indexscan = on enable_indexonlyscan = on enable_material = on enable_mergejoin = on enable_nestloop = on enable_seqscan = on enable_sort = on enable_tidscan = on # - Planner Cost Constants - seq_page_cost = 1.0 random_page_cost = 4.0 cpu_tuple_cost = 0.01 cpu_index_tuple_cost = 0.005 cpu_operator_cost = 0.0025 effective_cache_size = 128MB # - Genetic Query Optimizer - geqo = on geqo_threshold = 12 geqo_effort = 5 geqo_pool_size = 0 geqo_generations = 0 geqo_selection_bias = 2.0 geqo_seed = 0.0 # - Other Planner Options - default_statistics_target = 100 constraint_exclusion = partition cursor_tuple_fraction = 0.1 from_collapse_limit = 8 join_collapse_limit = 8 #------------------------------------------------------------------------------ # ERROR REPORTING AND LOGGING #------------------------------------------------------------------------------ # - Where to Log - log_destination = 'stderr' logging_collector = off log_directory = 'pg_log' log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' log_file_mode = 0600 log_truncate_on_rotation = off log_rotation_age = 1d log_rotation_size = 10MB syslog_facility = 'LOCAL0' syslog_ident = 'postgres' event_source = 'PostgreSQL' # - When to Log - client_min_messages = notice log_min_messages = warning log_min_error_statement = error log_min_duration_statement = -1 # - What to Log - debug_print_parse = off debug_print_rewritten = off debug_print_plan = off debug_pretty_print = on log_checkpoints = off log_connections = off log_disconnections = off log_duration = off log_error_verbosity = default # terse, default, or verbose messages log_hostname = off log_line_prefix = '%t ' log_lock_waits = off log_statement = 'none' log_temp_files = -1 log_timezone = 'UTC' #------------------------------------------------------------------------------ # RUNTIME STATISTICS #------------------------------------------------------------------------------ # - Query/Index Statistics Collector - track_activities = on track_counts = on track_io_timing = off track_functions = none # none, pl, all track_activity_query_size = 1024 update_process_title = on stats_temp_directory = 'pg_stat_tmp' # - Statistics Monitoring - log_parser_stats = off log_planner_stats = off log_executor_stats = off log_statement_stats = off #------------------------------------------------------------------------------ # AUTOVACUUM PARAMETERS #------------------------------------------------------------------------------ autovacuum = on log_autovacuum_min_duration = -1 autovacuum_max_workers = 3 autovacuum_naptime = 1min autovacuum_vacuum_threshold = 50 autovacuum_analyze_threshold = 50 autovacuum_vacuum_scale_factor = 0.2 autovacuum_analyze_scale_factor = 0.1 autovacuum_freeze_max_age = 200000000 autovacuum_vacuum_cost_delay = 20ms autovacuum_vacuum_cost_limit = -1 #------------------------------------------------------------------------------ # CLIENT CONNECTION DEFAULTS #------------------------------------------------------------------------------ # - Statement Behavior - search_path = '"$user",public' default_tablespace = '' temp_tablespaces = '' check_function_bodies = on default_transaction_isolation = 'read committed' default_transaction_read_only = off default_transaction_deferrable = off session_replication_role = 'origin' statement_timeout = 0 lock_timeout = 0 vacuum_freeze_min_age = 50000000 vacuum_freeze_table_age = 150000000 bytea_output = 'hex' xmlbinary = 'base64' xmloption = 'content' # - Locale and Formatting - datestyle = 'iso,mdy' intervalstyle = 'postgres' timezone = 'UTC' timezone_abbreviations = 'Default' extra_float_digits = 0 client_encoding = sql_ascii lc_messages = 'en_US.UTF-8' lc_monetary = 'en_US.UTF-8' lc_numeric = 'en_US.UTF-8' lc_time = 'en_US.UTF-8' default_text_search_config = 'pg_catalog.english' dynamic_library_path = '$libdir' local_preload_libraries = '' #------------------------------------------------------------------------------ # LOCK MANAGEMENT #------------------------------------------------------------------------------ deadlock_timeout = 1s max_locks_per_transaction = 64 max_pred_locks_per_transaction = 64 #------------------------------------------------------------------------------ # VERSION/PLATFORM COMPATIBILITY #------------------------------------------------------------------------------ # - Previous PostgreSQL Versions - array_nulls = on backslash_quote = safe_encoding # on, off, or safe_encoding default_with_oids = off escape_string_warning = on lo_compat_privileges = off quote_all_identifiers = off #sql_inheritance = on standard_conforming_strings = on synchronize_seqscans = on # - Other Platforms and Clients - transform_null_equals = off #------------------------------------------------------------------------------ # ERROR HANDLING #------------------------------------------------------------------------------ exit_on_error = off restart_after_crash = on #------------------------------------------------------------------------------ # CONFIG FILE INCLUDES #------------------------------------------------------------------------------ # These options allow settings to be loaded from files other than the # default postgresql.conf. #include_dir = 'conf.d' # include files ending in '.conf' from # directory 'conf.d' #include_if_exists = 'exists.conf' # include file only if it exists #include = 'special.conf' # include file #------------------------------------------------------------------------------ # CUSTOMIZED OPTIONS #------------------------------------------------------------------------------ # Add settings for extensions here