Home Explore Blog CI



postgresql

26th chunk of `doc/src/sgml/catalogs.sgml`
284b49895cb9b0f0c76ab903d10a0147457a5d6c68d9fe2c0000000100000fb0
 role="column_definition">
       <structfield>relhasindex</structfield> <type>bool</type>
      </para>
      <para>
       True if this is a table and it has (or recently had) any indexes
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relisshared</structfield> <type>bool</type>
      </para>
      <para>
       True if this table is shared across all databases in the cluster.  Only
       certain system catalogs (such as <link linkend="catalog-pg-database"><structname>pg_database</structname></link>)
       are shared.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relpersistence</structfield> <type>char</type>
      </para>
      <para>
       <literal>p</literal> = permanent table/sequence, <literal>u</literal> = unlogged table/sequence,
       <literal>t</literal> = temporary table/sequence
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relkind</structfield> <type>char</type>
      </para>
      <para>
       <literal>r</literal> = ordinary table,
       <literal>i</literal> = index,
       <literal>S</literal> = sequence,
       <literal>t</literal> = TOAST table,
       <literal>v</literal> = view,
       <literal>m</literal> = materialized view,
       <literal>c</literal> = composite type,
       <literal>f</literal> = foreign table,
       <literal>p</literal> = partitioned table,
       <literal>I</literal> = partitioned index
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relnatts</structfield> <type>int2</type>
      </para>
      <para>
       Number of user columns in the relation (system columns not
       counted).  There must be this many corresponding entries in
       <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.  See also
       <structname>pg_attribute</structname>.<structfield>attnum</structfield>.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relchecks</structfield> <type>int2</type>
      </para>
      <para>
       Number of <literal>CHECK</literal> constraints on the table; see
       <link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link> catalog
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relhasrules</structfield> <type>bool</type>
      </para>
      <para>
       True if table has (or once had) rules; see
       <link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link> catalog
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relhastriggers</structfield> <type>bool</type>
      </para>
      <para>
       True if table has (or once had) triggers; see
       <link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link> catalog
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relhassubclass</structfield> <type>bool</type>
      </para>
      <para>
       True if table or index has (or once had) any inheritance children or partitions
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>relrowsecurity</structfield> <type>bool</type>
      </para>
      <para>
       True if table has row-level security enabled; see
       <link linkend="catalog-pg-policy"><structname>pg_policy</structname></link> catalog
      </para></entry>
     </row>

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

Title: pg_class Columns (Continued)
Summary
This section details further columns of the pg_class catalog table, describing the attributes of database relations. It covers whether the relation has indexes (relhasindex), if it's shared across databases (relisshared), its persistence type (relpersistence), the kind of relation (relkind), the number of user columns (relnatts), the number of CHECK constraints (relchecks), whether it has rules (relhasrules), if it has triggers (relhastriggers), whether it has inheritance children or partitions (relhassubclass), and if row-level security is enabled (relrowsecurity).