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):
inhrelidoidreferencespg_class.oid
The OID of the child table or indexinhparentoidreferencespg_class.oid
The OID of the parent table or indexinhseqnoint4
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.inhdetachpendingbool
true for a partition that is in the process of being detached; false otherwise.
Related catalogs
This object references the following other system catalogs:
inhrelid→pg_class
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.