Guest User

Untitled

a guest
Feb 21st, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.87 KB | None | 0 0
  1. $ psql -U postgres
  2. postgres=# SHOW config_file;
  3.  
  4. /etc/postgresql/9.1/main/postgresql.conf
  5.  
  6. sudo updatedb
  7.  
  8. locate postgresql.conf
  9.  
  10. SHOW config_file;
  11.  
  12. [root@defiant /]# ll /var/lib/pgsql/data/postgresql.conf
  13.  
  14. -rw------- 1 postgres postgres 19332 Oct 14 09:38
  15. /var/lib/pgsql/data/postgresql.conf
  16.  
  17. # -----------------------------
  18. # PostgreSQL configuration file
  19. # -----------------------------
  20. #
  21. # This file consists of lines of the form:
  22. #
  23. # name = value
  24. #
  25. # (The "=" is optional.) Whitespace may be used. Comments are introduced with
  26. # "#" anywhere on a line. The complete list of parameter names and allowed
  27. # values can be found in the PostgreSQL documentation.
  28. #
  29. # The commented-out settings shown in this file represent the default values.
  30. # Re-commenting a setting is NOT sufficient to revert it to the default value;
  31. # you need to reload the server.
  32. #
  33. # This file is read on server startup and when the server receives a SIGHUP
  34. # signal. If you edit the file on a running system, you have to SIGHUP the
  35. # server for the changes to take effect, or use "pg_ctl reload". Some
  36. # parameters, which are marked below, require a server shutdown and restart to
  37. # take effect.
  38. #
  39. # Any parameter can also be given as a command-line option to the server, e.g.,
  40. # "postgres -c log_connections=on". Some parameters can be changed at run time
  41. # with the "SET" SQL command.
  42. #
  43. # Memory units: kB = kilobytes Time units: ms = milliseconds
  44. # MB = megabytes s = seconds
  45. # GB = gigabytes min = minutes
  46. # h = hours
  47. # d = days
  48.  
  49.  
  50. #------------------------------------------------------------------------------
  51. # FILE LOCATIONS
  52. #------------------------------------------------------------------------------
  53.  
  54. # The default values of these variables are driven from the -D command-line
  55. # option or PGDATA environment variable, represented here as ConfigDir.
  56.  
  57. #data_directory = 'ConfigDir' # use data in another directory
  58. # (change requires restart)
  59. #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
  60. # (change requires restart)
  61. #ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
  62. # (change requires restart)
  63.  
  64. # If external_pid_file is not explicitly set, no extra PID file is written.
  65. #external_pid_file = '(none)' # write an extra PID file
  66. # (change requires restart)
  67.  
  68.  
  69. #------------------------------------------------------------------------------
  70. # CONNECTIONS AND AUTHENTICATION
  71. #------------------------------------------------------------------------------
  72.  
  73. # - Connection Settings -
  74.  
  75. #listen_addresses = 'localhost' # what IP address(es) to listen on;
  76.  
  77. # comma-separated list of addresses;
  78. # defaults to 'localhost', '*' = all
  79. # (change requires restart)
  80. #port = 5432 # (change requires restart)
  81. # Note: In RHEL/Fedora installations, you can't set the port number here;
  82. # adjust it in the service file instead.
  83. max_connections = 100 # (change requires restart)
  84. # Note: Increasing max_connections costs ~400 bytes of shared memory per
  85. # connection slot, plus lock space (see max_locks_per_transaction).
  86. #superuser_reserved_connections = 3 # (change requires restart)
  87. #unix_socket_directories = '/var/run/postgresql, /tmp'
  88. # comma-separated list of directories
  89. # (change requires restart)
  90. #unix_socket_group = '' # (change requires restart)
  91. #unix_socket_permissions = 0777 # begin with 0 to use octal notation
  92. # (change requires restart)
  93. #bonjour = off # advertise server via Bonjour
  94. # (change requires restart)
  95. #bonjour_name = '' # defaults to the computer name
  96. # (change requires restart)
  97.  
  98. # - Security and Authentication -
  99.  
  100. #authentication_timeout = 1min # 1s-600s
  101. #ssl = off # (change requires restart)
  102. #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
  103. # (change requires restart)
  104. #ssl_renegotiation_limit = 512MB # amount of data between renegotiations
  105. #password_encryption = on
  106. #db_user_namespace = off
  107.  
  108. # Kerberos and GSSAPI
  109. #krb_server_keyfile = ''
  110. #krb_srvname = 'postgres' # (Kerberos only)
  111. #krb_caseins_users = off
  112.  
  113. # - TCP Keepalives -
  114. # see "man 7 tcp" for details
  115.  
  116. #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
  117. # 0 selects the system default
  118. #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
  119. # 0 selects the system default
  120. #tcp_keepalives_count = 0 # TCP_KEEPCNT;
  121. # 0 selects the system default
  122.  
  123.  
  124. #------------------------------------------------------------------------------
  125. # RESOURCE USAGE (except WAL)
  126. #------------------------------------------------------------------------------
  127.  
  128. # - Memory -
  129.  
  130. shared_buffers = 24MB # min 128kB
  131. # (change requires restart)
  132. #temp_buffers = 8MB # min 800kB
  133. #max_prepared_transactions = 0 # zero disables the feature
  134. # (change requires restart)
  135. # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
  136. # per transaction slot, plus lock space (see max_locks_per_transaction).
  137. # It is not advisable to set max_prepared_transactions nonzero unless you
  138. # actively intend to use prepared transactions.
  139. #work_mem = 1MB # min 64kB
  140. #maintenance_work_mem = 16MB # min 1MB
  141. #max_stack_depth = 2MB # min 100kB
  142.  
  143. # - Kernel Resource Usage -
  144.  
  145. #max_files_per_process = 1000 # min 25
  146. # (change requires restart)
  147. #shared_preload_libraries = '' # (change requires restart)
  148.  
  149. # - Cost-Based Vacuum Delay -
  150.  
  151. #vacuum_cost_delay = 0ms # 0-100 milliseconds
  152. #vacuum_cost_page_hit = 1 # 0-10000 credits
  153. #vacuum_cost_page_miss = 10 # 0-10000 credits
  154. #vacuum_cost_page_dirty = 20 # 0-10000 credits
  155. #vacuum_cost_limit = 200 # 1-10000 credits
  156.  
  157. # - Background Writer -
  158.  
  159. #bgwriter_delay = 200ms # 10-10000ms between rounds
  160. #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
  161. #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round
  162.  
  163. # - Asynchronous Behavior -
  164.  
  165. #effective_io_concurrency = 1 # 1-1000. 0 disables prefetching
  166.  
  167.  
  168. #------------------------------------------------------------------------------
  169. # WRITE AHEAD LOG
  170. #------------------------------------------------------------------------------
  171.  
  172. # - Settings -
  173.  
  174. #wal_level = minimal # minimal, archive, or hot_standby
  175. # (change requires restart)
  176. #fsync = on # turns forced synchronization on or off
  177. #synchronous_commit = on # synchronization level; on, off, or local
  178. #wal_sync_method = fsync # the default is the first option
  179. # supported by the operating system:
  180. # open_datasync
  181. # fdatasync (default on Linux)
  182. # fsync
  183. # fsync_writethrough
  184. # open_sync
  185. #full_page_writes = on # recover from partial page writes
  186. #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
  187. # (change requires restart)
  188. #wal_writer_delay = 200ms # 1-10000 milliseconds
  189.  
  190. #commit_delay = 0 # range 0-100000, in microseconds
  191. #commit_siblings = 5 # range 1-1000
  192.  
  193. # - Checkpoints -
  194.  
  195. #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
  196. #checkpoint_timeout = 5min # range 30s-1h
  197. #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
  198. #checkpoint_warning = 30s # 0 disables
  199.  
  200. # - Archiving -
  201.  
  202. #archive_mode = off # allows archiving to be done
  203. # (change requires restart)
  204. #archive_command = '' # command to use to archive a logfile segment
  205. #archive_timeout = 0 # force a logfile segment switch after this
  206. # number of seconds; 0 disables
  207.  
  208.  
  209. #------------------------------------------------------------------------------
  210. # REPLICATION
  211. #------------------------------------------------------------------------------
  212.  
  213. # - Master Server -
  214.  
  215. # These settings are ignored on a standby server
  216.  
  217. #max_wal_senders = 0 # max number of walsender processes
  218. # (change requires restart)
  219. #wal_sender_delay = 1s # walsender cycle time, 1-10000 milliseconds
  220. #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
  221. #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
  222. #replication_timeout = 60s # in milliseconds; 0 disables
  223. #synchronous_standby_names = '' # standby servers that provide sync rep
  224. # comma-separated list of application_name
  225. # from standby(s); '*' = all
  226.  
  227. # - Standby Servers -
  228.  
  229. # These settings are ignored on a master server
  230.  
  231. #hot_standby = off # "on" allows queries during recovery
  232. # (change requires restart)
  233. #max_standby_archive_delay = 30s # max delay before canceling queries
  234. # when reading WAL from archive;
  235. # -1 allows indefinite delay
  236. #max_standby_streaming_delay = 30s # max delay before canceling queries
  237. # when reading streaming WAL;
  238. # -1 allows indefinite delay
  239. #wal_receiver_status_interval = 10s # send replies at least this often
  240. # 0 disables
  241. #hot_standby_feedback = off # send info from standby to prevent
  242. # query conflicts
  243.  
  244.  
  245. #------------------------------------------------------------------------------
  246. # QUERY TUNING
  247. #------------------------------------------------------------------------------
  248.  
  249. # - Planner Method Configuration -
  250.  
  251. #enable_bitmapscan = on
  252. #enable_hashagg = on
  253. #enable_hashjoin = on
  254. #enable_indexscan = on
  255. #enable_material = on
  256. #enable_mergejoin = on
  257. #enable_nestloop = on
  258. #enable_seqscan = on
  259. #enable_sort = on
  260. #enable_tidscan = on
  261.  
  262. # - Planner Cost Constants -
  263.  
  264. #seq_page_cost = 1.0 # measured on an arbitrary scale
  265. #random_page_cost = 4.0 # same scale as above
  266. #cpu_tuple_cost = 0.01 # same scale as above
  267. #cpu_index_tuple_cost = 0.005 # same scale as above
  268. #cpu_operator_cost = 0.0025 # same scale as above
  269. #effective_cache_size = 128MB
  270.  
  271. # - Genetic Query Optimizer -
  272.  
  273. #geqo = on
  274. #geqo_threshold = 12
  275. #geqo_effort = 5 # range 1-10
  276. #geqo_pool_size = 0 # selects default based on effort
  277. #geqo_generations = 0 # selects default based on effort
  278. #geqo_selection_bias = 2.0 # range 1.5-2.0
  279. #geqo_seed = 0.0 # range 0.0-1.0
  280.  
  281. # - Other Planner Options -
  282.  
  283. #default_statistics_target = 100 # range 1-10000
  284. #constraint_exclusion = partition # on, off, or partition
  285. #cursor_tuple_fraction = 0.1 # range 0.0-1.0
  286. #from_collapse_limit = 8
  287. #join_collapse_limit = 8 # 1 disables collapsing of explicit
  288. # JOIN clauses
  289.  
  290.  
  291. #------------------------------------------------------------------------------
  292. # ERROR REPORTING AND LOGGING
  293. #------------------------------------------------------------------------------
  294.  
  295. # - Where to Log -
  296.  
  297. #log_destination = 'stderr' # Valid values are combinations of
  298. # stderr, csvlog, syslog, and eventlog,
  299. # depending on platform. csvlog
  300. # requires logging_collector to be on.
  301.  
  302. # This is used when logging to stderr:
  303. logging_collector = on # Enable capturing of stderr and csvlog
  304. # into log files. Required to be on for
  305. # csvlogs.
  306. # (change requires restart)
  307.  
  308. # These are only used if logging_collector is on:
  309. #log_directory = 'pg_log' # directory where log files are written,
  310. # can be absolute or relative to PGDATA
  311. log_filename = 'postgresql-%a.log' # log file name pattern,
  312. # can include strftime() escapes
  313. #log_file_mode = 0600 # creation mode for log files,
  314. # begin with 0 to use octal notation
  315. log_truncate_on_rotation = on # If on, an existing log file with the
  316. # same name as the new log file will be
  317. # truncated rather than appended to.
  318. # But such truncation only occurs on
  319. # time-driven rotation, not on restarts
  320. # or size-driven rotation. Default is
  321. # off, meaning append to existing files
  322. # in all cases.
  323. log_rotation_age = 1d # Automatic rotation of logfiles will
  324. # happen after that time. 0 disables.
  325. log_rotation_size = 0 # Automatic rotation of logfiles will
  326. # happen after that much log output.
  327. # 0 disables.
  328.  
  329. # These are relevant when logging to syslog:
  330. #syslog_facility = 'LOCAL0'
  331. #syslog_ident = 'postgres'
  332.  
  333. #silent_mode = off # Run server silently.
  334. # DO NOT USE without syslog or
  335. # logging_collector
  336. # (change requires restart)
  337.  
  338.  
  339. # - When to Log -
  340.  
  341. #client_min_messages = notice # values in order of decreasing detail:
  342. # debug5
  343. # debug4
  344. # debug3
  345. # debug2
  346. # debug1
  347. # log
  348. # notice
  349. # warning
  350. # error
  351.  
  352. #log_min_messages = warning # values in order of decreasing detail:
  353. # debug5
  354. # debug4
  355. # debug3
  356. # debug2
  357. # debug1
  358. # info
  359. # notice
  360. # warning
  361. # error
  362. # log
  363. # fatal
  364. # panic
  365.  
  366. #log_min_error_statement = error # values in order of decreasing detail:
  367. # debug5
  368. # debug4
  369. # debug3
  370. # debug2
  371. # debug1
  372. # info
  373. # notice
  374. # warning
  375. # error
  376. # log
  377. # fatal
  378. # panic (effectively off)
  379.  
  380. #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
  381. # and their durations, > 0 logs only
  382. # statements running at least this number
  383. # of milliseconds
  384.  
  385.  
  386. # - What to Log -
  387.  
  388. #debug_print_parse = off
  389. #debug_print_rewritten = off
  390. #debug_print_plan = off
  391. #debug_pretty_print = on
  392. #log_checkpoints = off
  393. #log_connections = off
  394. #log_disconnections = off
  395. #log_duration = off
  396. #log_error_verbosity = default # terse, default, or verbose messages
  397. #log_hostname = off
  398. #log_line_prefix = '' # special values:
  399. # %a = application name
  400. # %u = user name
  401. # %d = database name
  402. # %r = remote host and port
  403. # %h = remote host
  404. # %p = process ID
  405. # %t = timestamp without milliseconds
  406. # %m = timestamp with milliseconds
  407. # %i = command tag
  408. # %e = SQL state
  409. # %c = session ID
  410. # %l = session line number
  411. # %s = session start timestamp
  412. # %v = virtual transaction ID
  413. # %x = transaction ID (0 if none)
  414. # %q = stop here in non-session
  415. # processes
  416. # %% = '%'
  417. # e.g. '<%u%%%d> '
  418. #log_lock_waits = off # log lock waits >= deadlock_timeout
  419. #log_statement = 'none' # none, ddl, mod, all
  420. #log_temp_files = -1 # log temporary files equal or larger
  421. # than the specified size in kilobytes;
  422. # -1 disables, 0 logs all temp files
  423. #log_timezone = '(defaults to server environment setting)'
  424.  
  425.  
  426. #------------------------------------------------------------------------------
  427. # RUNTIME STATISTICS
  428. #------------------------------------------------------------------------------
  429.  
  430. # - Query/Index Statistics Collector -
  431.  
  432. #track_activities = on
  433. #track_counts = on
  434. #track_functions = none # none, pl, all
  435. #track_activity_query_size = 1024 # (change requires restart)
  436. #update_process_title = on
  437. #stats_temp_directory = 'pg_stat_tmp'
  438.  
  439.  
  440. # - Statistics Monitoring -
  441.  
  442. #log_parser_stats = off
  443. #log_planner_stats = off
  444. #log_executor_stats = off
  445. #log_statement_stats = off
  446.  
  447.  
  448. #------------------------------------------------------------------------------
  449. # AUTOVACUUM PARAMETERS
  450. #------------------------------------------------------------------------------
  451.  
  452. #autovacuum = on # Enable autovacuum subprocess? 'on'
  453. # requires track_counts to also be on.
  454. #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
  455. # their durations, > 0 logs only
  456. # actions running at least this number
  457. # of milliseconds.
  458. #autovacuum_max_workers = 3 # max number of autovacuum subprocesses
  459. # (change requires restart)
  460. #autovacuum_naptime = 1min # time between autovacuum runs
  461. #autovacuum_vacuum_threshold = 50 # min number of row updates before
  462. # vacuum
  463. #autovacuum_analyze_threshold = 50 # min number of row updates before
  464. # analyze
  465. #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
  466. #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
  467. #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
  468. # (change requires restart)
  469. #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
  470. # autovacuum, in milliseconds;
  471. # -1 means use vacuum_cost_delay
  472. #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
  473. # autovacuum, -1 means use
  474. # vacuum_cost_limit
  475.  
  476.  
  477. #------------------------------------------------------------------------------
  478. # CLIENT CONNECTION DEFAULTS
  479. #------------------------------------------------------------------------------
  480.  
  481. # - Statement Behavior -
  482.  
  483. #search_path = '"$user",public' # schema names
  484. #default_tablespace = '' # a tablespace name, '' uses the default
  485. #temp_tablespaces = '' # a list of tablespace names, '' uses
  486. # only default tablespace
  487. #check_function_bodies = on
  488. #default_transaction_isolation = 'read committed'
  489. #default_transaction_read_only = off
  490. #default_transaction_deferrable = off
  491. #session_replication_role = 'origin'
  492. #statement_timeout = 0 # in milliseconds, 0 is disabled
  493. #vacuum_freeze_min_age = 50000000
  494. #vacuum_freeze_table_age = 150000000
  495. #bytea_output = 'hex' # hex, escape
  496. #xmlbinary = 'base64'
  497. #xmloption = 'content'
  498.  
  499. # - Locale and Formatting -
  500.  
  501. datestyle = 'iso, mdy'
  502. #intervalstyle = 'postgres'
  503. #timezone = '(defaults to server environment setting)'
  504. #timezone_abbreviations = 'Default' # Select the set of available time zone
  505. # abbreviations. Currently, there are
  506. # Default
  507. # Australia
  508. # India
  509. # You can create your own file in
  510. # share/timezonesets/.
  511. #extra_float_digits = 0 # min -15, max 3
  512. #client_encoding = sql_ascii # actually, defaults to database
  513. # encoding
  514.  
  515. # These settings are initialized by initdb, but they can be changed.
  516. lc_messages = 'en_US.UTF-8' # locale for system error message
  517. # strings
  518. lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
  519. lc_numeric = 'en_US.UTF-8' # locale for number formatting
  520. lc_time = 'en_US.UTF-8' # locale for time formatting
  521.  
  522. # default configuration for text search
  523. default_text_search_config = 'pg_catalog.english'
  524.  
  525. # - Other Defaults -
  526.  
  527. #dynamic_library_path = '$libdir'
  528. #local_preload_libraries = ''
  529.  
  530.  
  531. #------------------------------------------------------------------------------
  532. # LOCK MANAGEMENT
  533. #------------------------------------------------------------------------------
  534.  
  535. #deadlock_timeout = 1s
  536. #max_locks_per_transaction = 64 # min 10
  537. # (change requires restart)
  538. # Note: Each lock table slot uses ~270 bytes of shared memory, and there are
  539. # max_locks_per_transaction * (max_connections + max_prepared_transactions)
  540. # lock table slots.
  541. #max_pred_locks_per_transaction = 64 # min 10
  542. # (change requires restart)
  543.  
  544. #------------------------------------------------------------------------------
  545. # VERSION/PLATFORM COMPATIBILITY
  546. #------------------------------------------------------------------------------
  547.  
  548. # - Previous PostgreSQL Versions -
  549.  
  550. #array_nulls = on
  551. #backslash_quote = safe_encoding # on, off, or safe_encoding
  552. #default_with_oids = off
  553. #escape_string_warning = on
  554. #lo_compat_privileges = off
  555. #quote_all_identifiers = off
  556. #sql_inheritance = on
  557. #standard_conforming_strings = on
  558. #synchronize_seqscans = on
  559.  
  560. # - Other Platforms and Clients -
  561.  
  562. #transform_null_equals = off
  563.  
  564.  
  565. #------------------------------------------------------------------------------
  566. # ERROR HANDLING
  567. #------------------------------------------------------------------------------
  568.  
  569. #exit_on_error = off # terminate session on any error?
  570. #restart_after_crash = on # reinitialize after backend crash?
  571.  
  572.  
  573. #------------------------------------------------------------------------------
  574. # CUSTOMIZED OPTIONS
  575. #------------------------------------------------------------------------------
  576.  
  577. #custom_variable_classes = '' # list of custom variable class names
  578.  
  579. $ cd /var/lib/pgsql/data
  580. $ ls -ltr *.conf
  581.  
  582. -rw-------. 1 postgres postgres 20453 Jan 18 23:22 postgresql.conf
  583. -rw-------. 1 postgres postgres 1636 Jan 18 23:22 pg_ident.conf
  584. -rw-------. 1 postgres postgres 4476 Jan 18 23:22 pg_hba.conf
  585.  
  586. /var/lib/pgsql/9.3/data
  587. /var/lib/pgsql/9.4/data
  588.  
  589. SHOW hba_file;
  590.  
  591. hba_file
  592. ---------------------------------
  593. /var/lib/pgsql/data/pg_hba.conf
  594. (1 row)
  595.  
  596. [root@localhost /]# yum -y install postgresql93 postgresql93-server
  597. [root@localhost /]# ls /var/lib/pgsql/9.3/data/
  598. [root@localhost /]#
  599. [root@localhost /]# service postgresql-9.3 initdb
  600. Initializing database: [ OK ]
  601. [root@localhost /]# ls /var/lib/pgsql/9.3/data/
  602. base pg_ident.conf pg_serial pg_subtrans pg_xlog
  603. global pg_log pg_snapshots pg_tblspc postgresql.conf
  604. pg_clog pg_multixact pg_stat pg_twophase
  605. pg_hba.conf pg_notify pg_stat_tmp PG_VERSION
  606. [root@localhost /]#
  607.  
  608. /var/lib/pgsql/9.4/data
Add Comment
Please, Sign In to add comment