Home Explore Blog CI



postgresql

42th chunk of `doc/src/sgml/system-views.sgml`
98a1197e0e3002d7cad3409f6bf0535f503e2b5d434b21050000000100000fa0
 subsequently-launched sessions.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <!-- PGC_SUSET -->
    <term><literal>superuser</literal></term>
    <listitem>
     <para>
      These settings can be set from <filename>postgresql.conf</filename>,
      or within a session via the <command>SET</command> command; but only superusers
      and users with the appropriate <literal>SET</literal> privilege
      can change them via <command>SET</command>.  Changes in
      <filename>postgresql.conf</filename> will affect existing sessions
      only if no session-local value has been established with <command>SET</command>.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <!-- PGC_USERSET -->
    <term><literal>user</literal></term>
    <listitem>
     <para>
      These settings can be set from <filename>postgresql.conf</filename>,
      or within a session via the <command>SET</command> command.  Any user is
      allowed to change their session-local value.  Changes in
      <filename>postgresql.conf</filename> will affect existing sessions
      only if no session-local value has been established with <command>SET</command>.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>

  <para>
   See <xref linkend="config-setting"/> for more information about the various
   ways to change these parameters.
  </para>

  <para>
   This view cannot be inserted into or deleted from, but it can be updated.  An
   <command>UPDATE</command> applied to a row of <structname>pg_settings</structname>
   is equivalent to executing the <command>SET</command> command on that named
   parameter. The change only affects the value used by the current
   session. If an <command>UPDATE</command> is issued within a transaction
   that is later aborted, the effects of the <command>UPDATE</command> command
   disappear when the transaction is rolled back. Once the surrounding
   transaction is committed, the effects will persist until the end of the
   session, unless overridden by another <command>UPDATE</command> or
   <command>SET</command>.
  </para>

  <para>
   This view does not
   display <link linkend="runtime-config-custom">customized options</link>
   unless the extension module that defines them has been loaded by the
   backend process executing the query (e.g., via a mention in
   <xref linkend="guc-shared-preload-libraries"/>,
   a call to a C function in the extension, or the
   <link linkend="sql-load"><command>LOAD</command></link> command).
   For example, since <link linkend="archive-modules">archive modules</link>
   are normally loaded only by the archiver process not regular sessions,
   this view will not display any customized options defined by such modules
   unless special action is taken to load them into the backend process
   executing the query.
  </para>

 </sect1>

 <sect1 id="view-pg-shadow">
  <title><structname>pg_shadow</structname></title>

  <indexterm zone="view-pg-shadow">
   <primary>pg_shadow</primary>
  </indexterm>

  <para>
   The view <structname>pg_shadow</structname> exists for backwards
   compatibility: it emulates a catalog that existed in
   <productname>PostgreSQL</productname> before version 8.1.
   It shows properties of all roles that are marked as
   <structfield>rolcanlogin</structfield> in
   <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.
  </para>

  <para>
   The name stems from the fact that this table
   should not be readable by the public since it contains passwords.
   <link linkend="view-pg-user"><structname>pg_user</structname></link>
   is a publicly readable view on
   <structname>pg_shadow</structname> that blanks out the password field.
  </para>

  <table>
   <title><structname>pg_shadow</structname> Columns</title>
   <tgroup cols="1">
    <thead>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       Column Type
      </para>
      <para>
       Description
     

Title: System Views in PostgreSQL
Summary
The text describes various system views in PostgreSQL, including pg_settings, which displays information about configuration parameters, and pg_shadow, which shows properties of roles that can log in, and explains how these views can be used to change settings and display information about roles and configuration parameters.