Home Explore Blog CI



postgresql

41th chunk of `doc/src/sgml/information_schema.sgml`
4fc1ca99cecec7fd3e17420db3c3faae9d781a6a2dadc6770000000100000fa2
 <structfield>option_name</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of an option
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>option_value</structfield> <type>character_data</type>
      </para>
      <para>
       Value of the option
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-foreign-tables">
  <title><literal>foreign_tables</literal></title>

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

  <table>
   <title><structname>foreign_tables</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>foreign_table_catalog</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the database that the foreign table is defined in (always the current database)
      </para></entry>
     </row>

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

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>foreign_table_name</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the foreign table
      </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 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
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>
 </sect1>

 <sect1 id="infoschema-key-column-usage">
  <title><literal>key_column_usage</literal></title>

  <para>
   The view <literal>key_column_usage</literal> identifies all columns
   in the current database that are restricted by some unique, primary
   key, or foreign key constraint.  Check constraints are not included
   in this view.  Only those columns are shown that the current user
   has access to, by way of being the owner or having some privilege.
  </para>

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

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

Title: Information Schema: Foreign Tables and Key Column Usage
Summary
This section describes the information schema views, including foreign_tables, which lists foreign tables in the current database, and key_column_usage, which identifies columns restricted by unique, primary key, or foreign key constraints, with both views showing only columns accessible to the current user, and detailing the structure of these views with their respective columns and data types.