gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 line
12KB

  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>51.86. pg_settings</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="view-pg-sequences.html" title="51.85. pg_sequences" /><link rel="next" href="view-pg-shadow.html" title="51.87. pg_shadow" /></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">51.86. <code xmlns="http://www.w3.org/1999/xhtml" class="structname">pg_settings</code></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="view-pg-sequences.html" title="51.85. pg_sequences">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="catalogs.html" title="Chapter 51. System Catalogs">Up</a></td><th width="60%" align="center">Chapter 51. System Catalogs</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="view-pg-shadow.html" title="51.87. pg_shadow">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="VIEW-PG-SETTINGS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">51.86. <code class="structname">pg_settings</code></h2></div></div></div><a id="id-1.10.4.88.2" class="indexterm"></a><p>
  3. The view <code class="structname">pg_settings</code> provides access to
  4. run-time parameters of the server. It is essentially an alternative
  5. interface to the <a class="xref" href="sql-show.html" title="SHOW"><span class="refentrytitle">SHOW</span></a>
  6. and <a class="xref" href="sql-set.html" title="SET"><span class="refentrytitle">SET</span></a> commands.
  7. It also provides access to some facts about each parameter that are
  8. not directly available from <code class="command">SHOW</code>, such as minimum and
  9. maximum values.
  10. </p><div class="table" id="id-1.10.4.88.4"><p class="title"><strong>Table 51.87. <code class="structname">pg_settings</code> Columns</strong></p><div class="table-contents"><table class="table" summary="pg_settings Columns" border="1"><colgroup><col /><col /><col /></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code class="structfield">name</code></td><td><code class="type">text</code></td><td>Run-time configuration parameter name</td></tr><tr><td><code class="structfield">setting</code></td><td><code class="type">text</code></td><td>Current value of the parameter</td></tr><tr><td><code class="structfield">unit</code></td><td><code class="type">text</code></td><td>Implicit unit of the parameter</td></tr><tr><td><code class="structfield">category</code></td><td><code class="type">text</code></td><td>Logical group of the parameter</td></tr><tr><td><code class="structfield">short_desc</code></td><td><code class="type">text</code></td><td>A brief description of the parameter</td></tr><tr><td><code class="structfield">extra_desc</code></td><td><code class="type">text</code></td><td>Additional, more detailed, description of the parameter</td></tr><tr><td><code class="structfield">context</code></td><td><code class="type">text</code></td><td>Context required to set the parameter's value (see below)</td></tr><tr><td><code class="structfield">vartype</code></td><td><code class="type">text</code></td><td>Parameter type (<code class="literal">bool</code>, <code class="literal">enum</code>,
  11. <code class="literal">integer</code>, <code class="literal">real</code>, or <code class="literal">string</code>)
  12. </td></tr><tr><td><code class="structfield">source</code></td><td><code class="type">text</code></td><td>Source of the current parameter value</td></tr><tr><td><code class="structfield">min_val</code></td><td><code class="type">text</code></td><td>Minimum allowed value of the parameter (null for non-numeric
  13. values)</td></tr><tr><td><code class="structfield">max_val</code></td><td><code class="type">text</code></td><td>Maximum allowed value of the parameter (null for non-numeric
  14. values)</td></tr><tr><td><code class="structfield">enumvals</code></td><td><code class="type">text[]</code></td><td>Allowed values of an enum parameter (null for non-enum
  15. values)</td></tr><tr><td><code class="structfield">boot_val</code></td><td><code class="type">text</code></td><td>Parameter value assumed at server startup if the parameter is
  16. not otherwise set</td></tr><tr><td><code class="structfield">reset_val</code></td><td><code class="type">text</code></td><td>Value that <code class="command">RESET</code> would reset the parameter to
  17. in the current session</td></tr><tr><td><code class="structfield">sourcefile</code></td><td><code class="type">text</code></td><td>Configuration file the current value was set in (null for
  18. values set from sources other than configuration files, or when
  19. examined by a user who is neither a superuser or a member of
  20. <code class="literal">pg_read_all_settings</code>); helpful when using
  21. <code class="literal">include</code> directives in configuration files</td></tr><tr><td><code class="structfield">sourceline</code></td><td><code class="type">integer</code></td><td>Line number within the configuration file the current value was
  22. set at (null for values set from sources other than configuration files,
  23. or when examined by a user who is neither a superuser or a member of
  24. <code class="literal">pg_read_all_settings</code>).
  25. </td></tr><tr><td><code class="structfield">pending_restart</code></td><td><code class="type">boolean</code></td><td><code class="literal">true</code> if the value has been changed in the
  26. configuration file but needs a restart; or <code class="literal">false</code>
  27. otherwise.
  28. </td></tr></tbody></table></div></div><br class="table-break" /><p>
  29. There are several possible values of <code class="structfield">context</code>.
  30. In order of decreasing difficulty of changing the setting, they are:
  31. </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">internal</code></span></dt><dd><p>
  32. These settings cannot be changed directly; they reflect internally
  33. determined values. Some of them may be adjustable by rebuilding the
  34. server with different configuration options, or by changing options
  35. supplied to <code class="command">initdb</code>.
  36. </p></dd><dt><span class="term"><code class="literal">postmaster</code></span></dt><dd><p>
  37. These settings can only be applied when the server starts, so any change
  38. requires restarting the server. Values for these settings are typically
  39. stored in the <code class="filename">postgresql.conf</code> file, or passed on
  40. the command line when starting the server. Of course, settings with any
  41. of the lower <code class="structfield">context</code> types can also be
  42. set at server start time.
  43. </p></dd><dt><span class="term"><code class="literal">sighup</code></span></dt><dd><p>
  44. Changes to these settings can be made in
  45. <code class="filename">postgresql.conf</code> without restarting the server.
  46. Send a <span class="systemitem">SIGHUP</span> signal to the postmaster to
  47. cause it to re-read <code class="filename">postgresql.conf</code> and apply
  48. the changes. The postmaster will also forward the
  49. <span class="systemitem">SIGHUP</span> signal to its child processes so that
  50. they all pick up the new value.
  51. </p></dd><dt><span class="term"><code class="literal">superuser-backend</code></span></dt><dd><p>
  52. Changes to these settings can be made in
  53. <code class="filename">postgresql.conf</code> without restarting the server.
  54. They can also be set for a particular session in the connection request
  55. packet (for example, via <span class="application">libpq</span>'s <code class="literal">PGOPTIONS</code>
  56. environment variable), but only if the connecting user is a superuser.
  57. However, these settings never change in a session after it is started.
  58. If you change them in <code class="filename">postgresql.conf</code>, send a
  59. <span class="systemitem">SIGHUP</span> signal to the postmaster to cause it to
  60. re-read <code class="filename">postgresql.conf</code>. The new values will only
  61. affect subsequently-launched sessions.
  62. </p></dd><dt><span class="term"><code class="literal">backend</code></span></dt><dd><p>
  63. Changes to these settings can be made in
  64. <code class="filename">postgresql.conf</code> without restarting the server.
  65. They can also be set for a particular session in the connection request
  66. packet (for example, via <span class="application">libpq</span>'s <code class="literal">PGOPTIONS</code>
  67. environment variable); any user can make such a change for their session.
  68. However, these settings never change in a session after it is started.
  69. If you change them in <code class="filename">postgresql.conf</code>, send a
  70. <span class="systemitem">SIGHUP</span> signal to the postmaster to cause it to
  71. re-read <code class="filename">postgresql.conf</code>. The new values will only
  72. affect subsequently-launched sessions.
  73. </p></dd><dt><span class="term"><code class="literal">superuser</code></span></dt><dd><p>
  74. These settings can be set from <code class="filename">postgresql.conf</code>,
  75. or within a session via the <code class="command">SET</code> command; but only superusers
  76. can change them via <code class="command">SET</code>. Changes in
  77. <code class="filename">postgresql.conf</code> will affect existing sessions
  78. only if no session-local value has been established with <code class="command">SET</code>.
  79. </p></dd><dt><span class="term"><code class="literal">user</code></span></dt><dd><p>
  80. These settings can be set from <code class="filename">postgresql.conf</code>,
  81. or within a session via the <code class="command">SET</code> command. Any user is
  82. allowed to change their session-local value. Changes in
  83. <code class="filename">postgresql.conf</code> will affect existing sessions
  84. only if no session-local value has been established with <code class="command">SET</code>.
  85. </p></dd></dl></div><p>
  86. See <a class="xref" href="config-setting.html" title="19.1. Setting Parameters">Section 19.1</a> for more information about the various
  87. ways to change these parameters.
  88. </p><p>
  89. The <code class="structname">pg_settings</code> view cannot be inserted into or
  90. deleted from, but it can be updated. An <code class="command">UPDATE</code> applied
  91. to a row of <code class="structname">pg_settings</code> is equivalent to executing
  92. the <a class="xref" href="sql-set.html" title="SET"><span class="refentrytitle">SET</span></a> command on that named
  93. parameter. The change only affects the value used by the current
  94. session. If an <code class="command">UPDATE</code> is issued within a transaction
  95. that is later aborted, the effects of the <code class="command">UPDATE</code> command
  96. disappear when the transaction is rolled back. Once the surrounding
  97. transaction is committed, the effects will persist until the end of the
  98. session, unless overridden by another <code class="command">UPDATE</code> or
  99. <code class="command">SET</code>.
  100. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="view-pg-sequences.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="catalogs.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="view-pg-shadow.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">51.85. <code class="structname">pg_sequences</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 51.87. <code class="structname">pg_shadow</code></td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1