The generic B-tree

The generic B-tree secondary-access method has a default operator class, btree_ops, whose operator-class functions handle indexing for the built-in data types. These operator-class functions have the following functionality for built-in data types:
  • They order the data in lexicographical sequence.

    If this sequence is not logical for your opaque data type, you can define operator-class functions for the opaque data type that provide the sequence you need.

  • They expect to compare two single, one-dimensional values for a given data type.

    If the opaque data type holds more than one value, but you can define a single value for it, you can define operator-class functions for the opaque data type that compare two of these one-dimensional values. If you cannot define a one-dimensional value for the opaque data type, you cannot use a B-tree index as its secondary-access method.

To provide support for columns and user-defined functions of the opaque data type, you can extend the btree_ops operator-class functions so that they handle the new opaque data type. The generic B-tree secondary-access method uses the new operator-class functions to store values of the opaque data type in a B-tree index.

For more information about how to extend the default B-tree operator class, see Extensions of the btree_ops operator class.