Home Explore Blog CI



postgresql

78th chunk of `doc/src/sgml/information_schema.sgml`
b3ac7f760c0f02d2bce97b414cd832a43151a29d49aeea7d0000000100000fbb
  <para>
   The view <literal>tables</literal> contains all tables and views
   defined in the current database.  Only those tables and views are
   shown that the current user has access to (by way of being the
   owner or having some privilege).
  </para>

  <table>
   <title><structname>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>table_catalog</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Name of the database that contains the table (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
      </para></entry>
     </row>

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

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>table_type</structfield> <type>character_data</type>
      </para>
      <para>
       Type of the table: <literal>BASE TABLE</literal> for a
       persistent base table (the normal table type),
       <literal>VIEW</literal> for a view, <literal>FOREIGN</literal>
       for a foreign table, or
       <literal>LOCAL TEMPORARY</literal> for a temporary table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>self_referencing_column_name</structfield> <type>sql_identifier</type>
      </para>
      <para>
       Applies to a feature not available in <productname>PostgreSQL</productname>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>reference_generation</structfield> <type>character_data</type>
      </para>
      <para>
       Applies to a feature not available in <productname>PostgreSQL</productname>
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>user_defined_type_catalog</structfield> <type>sql_identifier</type>
      </para>
      <para>
       If the table is a typed table, the name of the database that
       contains the underlying data type (always the current
       database), else null.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>user_defined_type_schema</structfield> <type>sql_identifier</type>
      </para>
      <para>
       If the table is a typed table, the name of the schema that
       contains the underlying data type, else null.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>user_defined_type_name</structfield> <type>sql_identifier</type>
      </para>
      <para>
       If the table is a typed table, the name of the underlying data
       type, else null.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>is_insertable_into</structfield> <type>yes_or_no</type>
      </para>
      <para>
       <literal>YES</literal> if the table is insertable into,
       <literal>NO</literal> if not (Base tables are always insertable
       into, views not necessarily.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para

Title: Information Schema: Tables View
Summary
This section describes the tables view in the information schema, which contains information about all tables and views defined in the current database that the current user has access to, including columns for table catalog, schema, name, type, and other attributes such as insertability and underlying data type for typed tables.