pg_inherits — PostgreSQL system catalog

The PostgreSQL pg_inherits system catalog: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

The catalog pg_inherits records information about table and index inheritance hierarchies. There is one entry for each direct parent-child table or index relationship in the database. (Indirect inheritance can be determined by following chains of entries.)

(Description quoted from the official PostgreSQL documentation.)

Columns

The pg_inherits system catalog exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • inhrelid oid references pg_class.oid
    The OID of the child table or index
  • inhparent oid references pg_class.oid
    The OID of the parent table or index
  • inhseqno int4
    If there is more than one direct parent for a child table (multiple inheritance), this number tells the order in which the inherited columns are to be arranged. The count starts at 1. Indexes cannot have multiple inheritance, since they can only inherit when using declarative partitioning.
  • inhdetachpending bool
    true for a partition that is in the process of being detached; false otherwise.

Related catalogs

This object references the following other system catalogs:

Version applicability

Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.

Related & references

Reference: PostgreSQL documentation — pg_inherits.