gooderp18绿色标准版
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

74 lines
7.2KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>19.2. File Locations</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="config-setting.html" title="19.1. Setting Parameters" /><link rel="next" href="runtime-config-connection.html" title="19.3. Connections and Authentication" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">19.2. File Locations</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="config-setting.html" title="19.1. Setting Parameters">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="runtime-config.html" title="Chapter 19. Server Configuration">Up</a></td><th width="60%" align="center">Chapter 19. Server Configuration</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="runtime-config-connection.html" title="19.3. Connections and Authentication">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="RUNTIME-CONFIG-FILE-LOCATIONS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">19.2. File Locations</h2></div></div></div><p>
  3. In addition to the <code class="filename">postgresql.conf</code> file
  4. already mentioned, <span class="productname">PostgreSQL</span> uses
  5. two other manually-edited configuration files, which control
  6. client authentication (their use is discussed in <a class="xref" href="client-authentication.html" title="Chapter 20. Client Authentication">Chapter 20</a>). By default, all three
  7. configuration files are stored in the database cluster's data
  8. directory. The parameters described in this section allow the
  9. configuration files to be placed elsewhere. (Doing so can ease
  10. administration. In particular it is often easier to ensure that
  11. the configuration files are properly backed-up when they are
  12. kept separate.)
  13. </p><div class="variablelist"><dl class="variablelist"><dt id="GUC-DATA-DIRECTORY"><span class="term"><code class="varname">data_directory</code> (<code class="type">string</code>)
  14. <a id="id-1.6.6.5.3.1.1.3" class="indexterm"></a>
  15. </span></dt><dd><p>
  16. Specifies the directory to use for data storage.
  17. This parameter can only be set at server start.
  18. </p></dd><dt id="GUC-CONFIG-FILE"><span class="term"><code class="varname">config_file</code> (<code class="type">string</code>)
  19. <a id="id-1.6.6.5.3.2.1.3" class="indexterm"></a>
  20. </span></dt><dd><p>
  21. Specifies the main server configuration file
  22. (customarily called <code class="filename">postgresql.conf</code>).
  23. This parameter can only be set on the <code class="command">postgres</code> command line.
  24. </p></dd><dt id="GUC-HBA-FILE"><span class="term"><code class="varname">hba_file</code> (<code class="type">string</code>)
  25. <a id="id-1.6.6.5.3.3.1.3" class="indexterm"></a>
  26. </span></dt><dd><p>
  27. Specifies the configuration file for host-based authentication
  28. (customarily called <code class="filename">pg_hba.conf</code>).
  29. This parameter can only be set at server start.
  30. </p></dd><dt id="GUC-IDENT-FILE"><span class="term"><code class="varname">ident_file</code> (<code class="type">string</code>)
  31. <a id="id-1.6.6.5.3.4.1.3" class="indexterm"></a>
  32. </span></dt><dd><p>
  33. Specifies the configuration file for user name mapping
  34. (customarily called <code class="filename">pg_ident.conf</code>).
  35. This parameter can only be set at server start.
  36. See also <a class="xref" href="auth-username-maps.html" title="20.2. User Name Maps">Section 20.2</a>.
  37. </p></dd><dt id="GUC-EXTERNAL-PID-FILE"><span class="term"><code class="varname">external_pid_file</code> (<code class="type">string</code>)
  38. <a id="id-1.6.6.5.3.5.1.3" class="indexterm"></a>
  39. </span></dt><dd><p>
  40. Specifies the name of an additional process-ID (PID) file that the
  41. server should create for use by server administration programs.
  42. This parameter can only be set at server start.
  43. </p></dd></dl></div><p>
  44. In a default installation, none of the above parameters are set
  45. explicitly. Instead, the
  46. data directory is specified by the <code class="option">-D</code> command-line
  47. option or the <code class="envar">PGDATA</code> environment variable, and the
  48. configuration files are all found within the data directory.
  49. </p><p>
  50. If you wish to keep the configuration files elsewhere than the
  51. data directory, the <code class="command">postgres</code> <code class="option">-D</code>
  52. command-line option or <code class="envar">PGDATA</code> environment variable
  53. must point to the directory containing the configuration files,
  54. and the <code class="varname">data_directory</code> parameter must be set in
  55. <code class="filename">postgresql.conf</code> (or on the command line) to show
  56. where the data directory is actually located. Notice that
  57. <code class="varname">data_directory</code> overrides <code class="option">-D</code> and
  58. <code class="envar">PGDATA</code> for the location
  59. of the data directory, but not for the location of the configuration
  60. files.
  61. </p><p>
  62. If you wish, you can specify the configuration file names and locations
  63. individually using the parameters <code class="varname">config_file</code>,
  64. <code class="varname">hba_file</code> and/or <code class="varname">ident_file</code>.
  65. <code class="varname">config_file</code> can only be specified on the
  66. <code class="command">postgres</code> command line, but the others can be
  67. set within the main configuration file. If all three parameters plus
  68. <code class="varname">data_directory</code> are explicitly set, then it is not necessary
  69. to specify <code class="option">-D</code> or <code class="envar">PGDATA</code>.
  70. </p><p>
  71. When setting any of these parameters, a relative path will be interpreted
  72. with respect to the directory in which <code class="command">postgres</code>
  73. is started.
  74. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="config-setting.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="runtime-config.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="runtime-config-connection.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">19.1. Setting Parameters </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 19.3. Connections and Authentication</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1