Home Explore Blog CI



postgresql

91th chunk of `doc/src/sgml/information_schema.sgml`
0f40ae0d54c568c10193db324ae77aabe2c9994ae8c1443b0000000100000fa0

 </sect1>

 <sect1 id="infoschema-user-mappings">
  <title><literal>user_mappings</literal></title>

  <para>
   The view <literal>user_mappings</literal> contains all user
   mappings defined in the current database.  Only those user mappings
   are shown where the current user has access to the corresponding
   foreign server (by way of being the owner or having some
   privilege).
  </para>

  <table>
   <title><structname>user_mappings</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>authorization_identifier</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the user being mapped,
       or <literal>PUBLIC</literal> if the mapping is public
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>foreign_server_catalog</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the database that the foreign server used by this
       mapping is defined in (always the current database)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>foreign_server_name</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the foreign server used by this mapping
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-view-column-usage">
  <title><literal>view_column_usage</literal></title>

  <para>
   The view <literal>view_column_usage</literal> identifies all
   columns that are used in the query expression of a view (the
   <command>SELECT</command> statement that defines the view).  A
   column is only included if the table that contains the column is
   owned by a currently enabled role.
  </para>

  <note>
   <para>
    Columns of system tables are not included.  This should be fixed
    sometime.
   </para>
  </note>

  <table>
   <title><structname>view_column_usage</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>view_catalog</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the database that contains the view (always the current database)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>view_schema</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the schema that contains the view
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>view_name</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the view
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>table_catalog</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the database that contains the table that contains the
       column that is used by the view (always the current database)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>table_schema</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the schema that contains the table that

Title: Information Schema Views: User Mappings and View Column Usage
Summary
The information schema includes views like user_mappings, which details user mappings in the current database, and view_column_usage, which identifies columns used in view query expressions, with certain limitations such as excluding system table columns.