]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/view-pg-settings.html
PG 18 docs from https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0-docs...
[ai-pg] / full-docs / src / sgml / html / view-pg-settings.html
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>53.25. 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 Vsnapshot" /><link rel="prev" href="view-pg-sequences.html" title="53.24. pg_sequences" /><link rel="next" href="view-pg-shadow.html" title="53.26. pg_shadow" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">53.25. <code class="structname">pg_settings</code></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="view-pg-sequences.html" title="53.24. pg_sequences">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="views.html" title="Chapter 53. System Views">Up</a></td><th width="60%" align="center">Chapter 53. System Views</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="view-pg-shadow.html" title="53.26. pg_shadow">Next</a></td></tr></table><hr /></div><div class="sect1" id="VIEW-PG-SETTINGS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">53.25. <code class="structname">pg_settings</code> <a href="#VIEW-PG-SETTINGS" class="id_link">#</a></h2></div></div></div><a id="id-1.10.5.29.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="link" href="sql-show.html" title="SHOW"><code class="command">SHOW</code></a>
6    and <a class="link" href="sql-set.html" title="SET"><code class="command">SET</code></a> commands.
7    It also provides access to some facts about each parameter that are
8    not directly available from <a class="link" href="sql-show.html" title="SHOW"><code class="command">SHOW</code></a>, such as minimum and
9    maximum values.
10   </p><div class="table" id="id-1.10.5.29.4"><p class="title"><strong>Table 53.25. <code class="structname">pg_settings</code> Columns</strong></p><div class="table-contents"><table class="table" summary="pg_settings Columns" border="1"><colgroup><col /></colgroup><thead><tr><th class="catalog_table_entry"><p class="column_definition">
11        Column Type
12       </p>
13       <p>
14        Description
15       </p></th></tr></thead><tbody><tr><td class="catalog_table_entry"><p class="column_definition">
16        <code class="structfield">name</code> <code class="type">text</code>
17       </p>
18       <p>
19        Run-time configuration parameter name
20       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
21        <code class="structfield">setting</code> <code class="type">text</code>
22       </p>
23       <p>
24        Current value of the parameter
25       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
26        <code class="structfield">unit</code> <code class="type">text</code>
27       </p>
28       <p>
29        Implicit unit of the parameter
30       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
31        <code class="structfield">category</code> <code class="type">text</code>
32       </p>
33       <p>
34        Logical group of the parameter
35       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
36        <code class="structfield">short_desc</code> <code class="type">text</code>
37       </p>
38       <p>
39        A brief description of the parameter
40       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
41        <code class="structfield">extra_desc</code> <code class="type">text</code>
42       </p>
43       <p>
44        Additional, more detailed, description of the parameter
45       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
46        <code class="structfield">context</code> <code class="type">text</code>
47       </p>
48       <p>
49        Context required to set the parameter's value (see below)
50       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
51        <code class="structfield">vartype</code> <code class="type">text</code>
52       </p>
53       <p>
54        Parameter type (<code class="literal">bool</code>, <code class="literal">enum</code>,
55        <code class="literal">integer</code>, <code class="literal">real</code>, or <code class="literal">string</code>)
56       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
57        <code class="structfield">source</code> <code class="type">text</code>
58       </p>
59       <p>
60        Source of the current parameter value
61       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
62        <code class="structfield">min_val</code> <code class="type">text</code>
63       </p>
64       <p>
65        Minimum allowed value of the parameter (null for non-numeric
66        values)
67       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
68        <code class="structfield">max_val</code> <code class="type">text</code>
69       </p>
70       <p>
71        Maximum allowed value of the parameter (null for non-numeric
72        values)
73       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
74        <code class="structfield">enumvals</code> <code class="type">text[]</code>
75       </p>
76       <p>
77        Allowed values of an enum parameter (null for non-enum
78        values)
79       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
80        <code class="structfield">boot_val</code> <code class="type">text</code>
81       </p>
82       <p>
83        Parameter value assumed at server startup if the parameter is
84        not otherwise set
85       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
86        <code class="structfield">reset_val</code> <code class="type">text</code>
87       </p>
88       <p>
89        Value that <a class="link" href="sql-reset.html" title="RESET"><code class="command">RESET</code></a> would reset the parameter to
90        in the current session
91       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
92        <code class="structfield">sourcefile</code> <code class="type">text</code>
93       </p>
94       <p>
95        Configuration file the current value was set in (null for
96        values set from sources other than configuration files, or when
97        examined by a user who neither is a superuser nor has privileges of
98        <code class="literal">pg_read_all_settings</code>); helpful when using
99        <code class="literal">include</code> directives in configuration files
100       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
101        <code class="structfield">sourceline</code> <code class="type">int4</code>
102       </p>
103       <p>
104        Line number within the configuration file the current value was
105        set at (null for values set from sources other than configuration files,
106        or when examined by a user who neither is a superuser nor has privileges of
107        <code class="literal">pg_read_all_settings</code>).
108       </p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
109        <code class="structfield">pending_restart</code> <code class="type">bool</code>
110       </p>
111       <p>
112        <code class="literal">true</code> if the value has been changed in the
113        configuration file but needs a restart; or <code class="literal">false</code>
114        otherwise.
115       </p></td></tr></tbody></table></div></div><br class="table-break" /><p>
116    There are several possible values of <code class="structfield">context</code>.
117    In order of decreasing difficulty of changing the setting, they are:
118   </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal">internal</code></span></dt><dd><p>
119       These settings cannot be changed directly; they reflect internally
120       determined values.  Some of them may be adjustable by rebuilding the
121       server with different configuration options, or by changing options
122       supplied to <span class="application">initdb</span>.
123      </p></dd><dt><span class="term"><code class="literal">postmaster</code></span></dt><dd><p>
124       These settings can only be applied when the server starts, so any change
125       requires restarting the server.  Values for these settings are typically
126       stored in the <code class="filename">postgresql.conf</code> file, or passed on
127       the command line when starting the server.  Of course, settings with any
128       of the lower <code class="structfield">context</code> types can also be
129       set at server start time.
130      </p></dd><dt><span class="term"><code class="literal">sighup</code></span></dt><dd><p>
131       Changes to these settings can be made in
132       <code class="filename">postgresql.conf</code> without restarting the server.
133       Send a <span class="systemitem">SIGHUP</span> signal to the postmaster to
134       cause it to re-read <code class="filename">postgresql.conf</code> and apply
135       the changes.  The postmaster will also forward the
136       <span class="systemitem">SIGHUP</span> signal to its child processes so that
137       they all pick up the new value.
138      </p></dd><dt><span class="term"><code class="literal">superuser-backend</code></span></dt><dd><p>
139       Changes to these settings can be made in
140       <code class="filename">postgresql.conf</code> without restarting the server.
141       They can also be set for a particular session in the connection request
142       packet (for example, via <span class="application">libpq</span>'s <code class="literal">PGOPTIONS</code>
143       environment variable), but only if the connecting user is a superuser
144       or has been granted the appropriate <code class="literal">SET</code> privilege.
145       However, these settings never change in a session after it is started.
146       If you change them in <code class="filename">postgresql.conf</code>, send a
147       <span class="systemitem">SIGHUP</span> signal to the postmaster to cause it to
148       re-read <code class="filename">postgresql.conf</code>.  The new values will only
149       affect subsequently-launched sessions.
150      </p></dd><dt><span class="term"><code class="literal">backend</code></span></dt><dd><p>
151       Changes to these settings can be made in
152       <code class="filename">postgresql.conf</code> without restarting the server.
153       They can also be set for a particular session in the connection request
154       packet (for example, via <span class="application">libpq</span>'s <code class="literal">PGOPTIONS</code>
155       environment variable); any user can make such a change for their session.
156       However, these settings never change in a session after it is started.
157       If you change them in <code class="filename">postgresql.conf</code>, send a
158       <span class="systemitem">SIGHUP</span> signal to the postmaster to cause it to
159       re-read <code class="filename">postgresql.conf</code>.  The new values will only
160       affect subsequently-launched sessions.
161      </p></dd><dt><span class="term"><code class="literal">superuser</code></span></dt><dd><p>
162       These settings can be set from <code class="filename">postgresql.conf</code>,
163       or within a session via the <code class="command">SET</code> command; but only superusers
164       and users with the appropriate <code class="literal">SET</code> privilege
165       can change them via <code class="command">SET</code>.  Changes in
166       <code class="filename">postgresql.conf</code> will affect existing sessions
167       only if no session-local value has been established with <code class="command">SET</code>.
168      </p></dd><dt><span class="term"><code class="literal">user</code></span></dt><dd><p>
169       These settings can be set from <code class="filename">postgresql.conf</code>,
170       or within a session via the <code class="command">SET</code> command.  Any user is
171       allowed to change their session-local value.  Changes in
172       <code class="filename">postgresql.conf</code> will affect existing sessions
173       only if no session-local value has been established with <code class="command">SET</code>.
174      </p></dd></dl></div><p>
175    See <a class="xref" href="config-setting.html" title="19.1. Setting Parameters">Section 19.1</a> for more information about the various
176    ways to change these parameters.
177   </p><p>
178    This view cannot be inserted into or deleted from, but it can be updated.  An
179    <code class="command">UPDATE</code> applied to a row of <code class="structname">pg_settings</code>
180    is equivalent to executing the <code class="command">SET</code> command on that named
181    parameter. The change only affects the value used by the current
182    session. If an <code class="command">UPDATE</code> is issued within a transaction
183    that is later aborted, the effects of the <code class="command">UPDATE</code> command
184    disappear when the transaction is rolled back. Once the surrounding
185    transaction is committed, the effects will persist until the end of the
186    session, unless overridden by another <code class="command">UPDATE</code> or
187    <code class="command">SET</code>.
188   </p><p>
189    This view does not
190    display <a class="link" href="runtime-config-custom.html" title="19.16. Customized Options">customized options</a>
191    unless the extension module that defines them has been loaded by the
192    backend process executing the query (e.g., via a mention in
193    <a class="xref" href="runtime-config-client.html#GUC-SHARED-PRELOAD-LIBRARIES">shared_preload_libraries</a>,
194    a call to a C function in the extension, or the
195    <a class="link" href="sql-load.html" title="LOAD"><code class="command">LOAD</code></a> command).
196    For example, since <a class="link" href="archive-modules.html" title="Chapter 49. Archive Modules">archive modules</a>
197    are normally loaded only by the archiver process not regular sessions,
198    this view will not display any customized options defined by such modules
199    unless special action is taken to load them into the backend process
200    executing the query.
201   </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" title="53.24. pg_sequences">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="views.html" title="Chapter 53. System Views">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="view-pg-shadow.html" title="53.26. pg_shadow">Next</a></td></tr><tr><td width="40%" align="left" valign="top">53.24. <code class="structname">pg_sequences</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 53.26. <code class="structname">pg_shadow</code></td></tr></table></div></body></html>