The pg_partition system catalog table is used to track partitioned tables and their inheritance level relationships. Each row of pg_partition represents either the level of a partitioned table in the partition hierarchy, or a subpartition template description. The value of the attribute paristemplate determines what a particular row represents.

    columntypereferencesdescription
    parrelidoidpg_class.oidThe object identifier of the table.
    parkindchar The partition type - R for range or L for list.
    parlevelsmallint The partition level of this row: 0 for the top-level parent table, 1 for the first level under the parent table, 2 for the second level, and so on.
    paristemplateboolean Whether or not this row represents a subpartition template definition (true) or an actual partitioning level (false).
    parnattssmallint The number of attributes that define this level.
    parattsint2vector An array of the attribute numbers (as in pg_attribute.attnum) of the attributes that participate in defining this level.
    parclassoidvectorpg_opclass.oidThe operator class identifier(s) of the partition columns.

    Parent topic: System Catalogs Definitions