1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Add pg_file_settings view and function

The function and view added here provide a way to look at all settings
in postgresql.conf, any #include'd files, and postgresql.auto.conf
(which is what backs the ALTER SYSTEM command).

The information returned includes the configuration file name, line
number in that file, sequence number indicating when the parameter is
loaded (useful to see if it is later masked by another definition of the
same parameter), parameter name, and what it is set to at that point.
This information is updated on reload of the server.

This is unfiltered, privileged, information and therefore access is
restricted to superusers through the GRANT system.

Author: Sawada Masahiko, various improvements by me.
Reviewers: David Steele
This commit is contained in:
Stephen Frost
2015-05-08 19:09:26 -04:00
parent bab64ef9e8
commit a97e0c3354
7 changed files with 263 additions and 0 deletions

View File

@ -7559,6 +7559,11 @@
<entry>parameter settings</entry>
</row>
<row>
<entry><link linkend="view-pg-file-settings"><structname>pg_file_settings</structname></link></entry>
<entry>file location of parameter settings</entry>
</row>
<row>
<entry><link linkend="view-pg-shadow"><structname>pg_shadow</structname></link></entry>
<entry>database users</entry>
@ -9173,6 +9178,79 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
</sect1>
<sect1 id="view-pg-file-settings">
<title><structname>pg_file_settings</structname></title>
<indexterm zone="view-pg-file-settings">
<primary>pg_file_settings</primary>
</indexterm>
<para>
The view <structname>pg_file_settings</structname> provides the file
name, line number and value of all parameters which are set through
configuration files.
In contrast to <structname>pg_settings</structname>, a row is provided for
each occurrence of the parameter across all configuration files. This is helpful
for discovering why one value may have been used in preference to another
when the parameters were loaded.
</para>
<table>
<title><structname>pg_file_settings</> Columns</title>
<tgroup cols="3">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><structfield>sourcefile</structfield></entry>
<entry><structfield>text</structfield></entry>
<entry>Path to and name of the configration file</entry>
</row>
<row>
<entry><structfield>sourceline</structfield></entry>
<entry><structfield>integer</structfield></entry>
<entry>
Line number within the configuration file where the value was set
</entry>
</row>
<row>
<entry><structfield>seqno</structfield></entry>
<entry><structfield>integer</structfield></entry>
<entry>Order in which the setting was loaded</entry>
</row>
<row>
<entry><structfield>name</structfield></entry>
<entry><structfield>text</structfield></entry>
<entry>Run-time configuration parameter name</entry>
</row>
<row>
<entry><structfield>setting</structfield></entry>
<entry><structfield>text</structfield></entry>
<entry>value of the parameter</entry>
</row>
</tbody>
</tgroup>
</table>
<para>
See <xref linkend="config-setting"> for more information about the various
ways to change these parameters.
</para>
<para>
The <structname>pg_file_settings</structname> view cannot be modified
directly as it represents information, as read in at server start or
reload time, about all parameter settings across all configuration files.
</para>
</sect1>
<sect1 id="view-pg-shadow">
<title><structname>pg_shadow</structname></title>