The pg_opclass system catalog table defines index access method operator classes. Each operator class defines semantics for index columns of a particular data type and a particular index access method. An operator class essentially specifies that a particular operator family is applicable to a particular indexable column data type. The set of operators from the family that are actually usable with the indexed column are those that accept the column’s data type as their left-hand input.

    An operator class’s opcmethod must match the opfmethod of its containing operator family. Also, there must be no more than one pg_opclass row having opcdefault true for any given combination of opcmethod and opcintype.

    columntypereferencesdescription
    oidoid Row identifier (hidden attribute; must be explicitly selected)
    opcmethodoidpg_am.oidIndex access method operator class is for
    opcnamename Name of this operator class
    opcnamespaceoidpg_namespace.oidNamespace of this operator class
    opcowneroidpg_authid.oidOwner of the operator class
    opcfamilyoidpg_opfamily.oidOperator family containing the operator class
    opcintypeoidpg_type.oidData type that the operator class indexes
    opcdefaultboolean True if this operator class is the default for the data type opcintype
    opckeytypeoidpg_type.oidType of data stored in index, or zero if same as opcintype

    Parent topic: System Catalogs Definitions