Home Explore Blog CI



postgresql

43th chunk of `doc/src/sgml/system-views.sgml`
bd97c2b6c240926de9b225a5ba5b93ea731978d092fd314c0000000100000fb3
 <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
      </para></entry>
     </row>
    </thead>

    <tbody>
     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       User name
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usesysid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       ID of this user
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usecreatedb</structfield> <type>bool</type>
      </para>
      <para>
       User can create databases
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usesuper</structfield> <type>bool</type>
      </para>
      <para>
       User is a superuser
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>userepl</structfield> <type>bool</type>
      </para>
      <para>
       User can initiate streaming replication and put the system in and
       out of backup mode.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>usebypassrls</structfield> <type>bool</type>
      </para>
      <para>
       User bypasses every row-level security policy, see
       <xref linkend="ddl-rowsecurity"/> for more information.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>passwd</structfield> <type>text</type>
      </para>
      <para>
       Encrypted password; null if none.  See
       <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>
       for details of how encrypted passwords are stored.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>valuntil</structfield> <type>timestamptz</type>
      </para>
      <para>
       Password expiry time (only used for password authentication)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>useconfig</structfield> <type>text[]</type>
      </para>
      <para>
       Session defaults for run-time configuration variables
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

 </sect1>

 <sect1 id="view-pg-shmem-allocations">
  <title><structname>pg_shmem_allocations</structname></title>

  <indexterm zone="view-pg-shmem-allocations">

Title: pg_shadow View
Summary
The pg_shadow view in PostgreSQL exists for backwards compatibility and displays properties of roles that can log in, including user name, ID, database creation privileges, superuser status, and encrypted password information, among other details.