Home Explore Blog CI



postgresql

55th chunk of `doc/src/sgml/system-views.sgml`
ccb0b8e9a8be31bce4c22a7e869a319f7cde6a27a66cc2df0000000100000fa9
 preceding per-element
       frequencies, and optionally the frequency of null elements.
       (Null when <structfield>most_common_elems</structfield> is.)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>elem_count_histogram</structfield> <type>float4[]</type>
      </para>
      <para>
       A histogram of the counts of distinct non-null element values within the
       values of the expression, followed by the average number of distinct
       non-null elements.  (Null for scalar types.)
      </para></entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   The maximum number of entries in the array fields can be controlled on a
   column-by-column basis using the <link linkend="sql-altertable"><command>ALTER
   TABLE SET STATISTICS</command></link> command, or globally by setting the
   <xref linkend="guc-default-statistics-target"/> run-time parameter.
  </para>

 </sect1>

 <sect1 id="view-pg-tables">
  <title><structname>pg_tables</structname></title>

  <indexterm zone="view-pg-tables">
   <primary>pg_tables</primary>
  </indexterm>

  <para>
   The view <structname>pg_tables</structname> provides access to
   useful information about each table in the database.
  </para>

  <table>
   <title><structname>pg_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>schemaname</structfield> <type>name</type>
       (references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>nspname</structfield>)
      </para>
      <para>
       Name of schema containing table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablename</structfield> <type>name</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relname</structfield>)
      </para>
      <para>
       Name of table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tableowner</structfield> <type>name</type>
       (references <link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.<structfield>rolname</structfield>)
      </para>
      <para>
       Name of table's owner
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>tablespace</structfield> <type>name</type>
       (references <link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.<structfield>spcname</structfield>)
      </para>
      <para>
       Name of tablespace containing table (null if default for database)
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>hasindexes</structfield> <type>bool</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relhasindex</structfield>)
      </para>
      <para>
       True if table has (or recently had) any indexes
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>hasrules</structfield> <type>bool</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>relhasrules</structfield>)
      </para>
      <para>
       True if table has (or once had) rules
      </para></entry>
     </row>

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

Title: pg_tables View
Summary
The pg_tables view provides information about each table in the database, including schema name, table name, owner, tablespace, and flags indicating the presence of indexes and rules, allowing for easy access to table metadata.