Home Explore Blog CI



postgresql

67th chunk of `doc/src/sgml/catalogs.sgml`
2628b1d81c62718a4e2b511c24882f1f4fcc0cbeba4395480000000100000fa0
 <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>partrelid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The OID of the <link linkend="catalog-pg-class"><structname>pg_class</structname></link> entry for this partitioned table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>partstrat</structfield> <type>char</type>
      </para>
      <para>
       Partitioning strategy; <literal>h</literal> = hash partitioned table,
       <literal>l</literal> = list partitioned table, <literal>r</literal> = range partitioned table
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>partnatts</structfield> <type>int2</type>
      </para>
      <para>
       The number of columns in the partition key
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>partdefid</structfield> <type>oid</type>
       (references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       The OID of the <link linkend="catalog-pg-class"><structname>pg_class</structname></link> entry for the default partition
       of this partitioned table, or zero if this partitioned table does not
       have a default partition
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>partattrs</structfield> <type>int2vector</type>
       (references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attnum</structfield>)
      </para>
      <para>
       This is an array of <structfield>partnatts</structfield> values that
       indicate which table columns are part of the partition key.  For
       example, a value of <literal>1 3</literal> would mean that the first
       and the third table columns make up the partition key.  A zero in this
       array indicates that the corresponding partition key column is an
       expression, rather than a simple column reference.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>partclass</structfield> <type>oidvector</type>
       (references <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       For each column in the partition key, this contains the OID of the
       operator class to use.  See
       <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link> for details.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>partcollation</structfield> <type>oidvector</type>
       (references <link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.<structfield>oid</structfield>)
      </para>
      <para>
       For each column in the partition key, this contains the OID of the
       collation to use for partitioning, or zero if the column is not
       of a collatable data type.
      </para></entry>
     </row>

     <row>
      <entry role="catalog_table_entry"><para role="column_definition">
       <structfield>partexprs</structfield> <type>pg_node_tree</type>
      </para>
      <para>
       Expression trees (in <function>nodeToString()</function>
       representation) for partition key columns that are not simple column
       references.  This is a list with one element for each zero
       entry in <structfield>partattrs</structfield>.  Null if all partition key columns
 

Title: pg_partitioned_table Catalog Columns (Continued)
Summary
This section details the remaining columns of the `pg_partitioned_table` catalog, providing information about table partitioning. It describes columns like `partnatts` (number of columns in the partition key), `partdefid` (OID of the default partition), `partattrs` (array indicating table columns in the partition key), `partclass` (OID of the operator class for each partition key column), `partcollation` (OID of the collation for each partition key column), and `partexprs` (expression trees for partition key columns that aren't simple column references).