Updated on 2024-06-03 GMT+08:00

PG_OPCLASS

PG_OPCLASS 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 data types that accept the left-hand column.

Table 1 PG_OPCLASS columns

Name

Type

Reference

Description

OID

OID

-

Row identifier (hidden attribute, which must be specified)

opcmethod

OID

OID in PG_AM

Index access method operator class served by an operator class

opcname

name

-

Name of the operator class

opcnamespace

OID

OID in PG_NAMESPACE

Namespace of the operator class

opcowner

OID

OID in PG_AUTHID

Owner of the operator class

opcfamily

OID

OID in PG_OPFAMILY

Operator family containing the operator class

opcintype

OID

OID in PG_TYPE

Data type that the operator class indexes

opcdefault

Boolean

-

The value is t (true) if the operator class is the default for opcintype. Otherwise, the value is f (false).

opckeytype

OID

OID in PG_TYPE

Type of data stored in index, or zero if same as opcintype

An operator class's opcmethod must match the opfmethod of its containing operator family.