Skip to main content

OpClass

This class represents a PostgreSQL operator class for use in functional indexes. It allows for the customization of index behavior by specifying a specific operator class for a given expression or column.

Attributes

AttributeTypeDescription
templatestring = %(expressions)s %(name)sThe format string used to construct the SQL expression, positioning the expressions and the operator name.
constraint_validation_compatibleboolean = falseA boolean flag indicating whether this operator class can be used during the validation phase of database constraints.

Constructor

Signature

def OpClass(
expression: Any,
name: str
) - > null

Parameters

NameTypeDescription
expressionAnyThe expression to be processed by the operator.
namestrThe name of the operator.

Signature

def OpClass(
expression: expression,
name: string
) - > null

Parameters

NameTypeDescription
expressionexpressionThe database expression or column to which the operator class will be applied.
namestringThe specific name of the PostgreSQL operator class to use for indexing.