From 59a66f05126a4f9622f67ac71ccc149c805a6ccd Mon Sep 17 00:00:00 2001 From: Hannes Ljungberg Date: Wed, 8 Dec 2021 21:28:08 +0100 Subject: Refs #33342 -- Deprecated ExclusionConstraint.opclasses. --- docs/ref/contrib/postgres/constraints.txt | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'docs/ref/contrib/postgres') diff --git a/docs/ref/contrib/postgres/constraints.txt b/docs/ref/contrib/postgres/constraints.txt index fe7d53bb79..1ea1fcfb8f 100644 --- a/docs/ref/contrib/postgres/constraints.txt +++ b/docs/ref/contrib/postgres/constraints.txt @@ -53,10 +53,22 @@ operators with strings. For example:: Only commutative operators can be used in exclusion constraints. +The :class:`OpClass() ` expression can +be used to specify a custom `operator class`_ for the constraint expressions. +For example:: + + expressions=[ + (OpClass('circle', name='circle_ops'), RangeOperators.OVERLAPS), + ] + +creates an exclusion constraint on ``circle`` using ``circle_ops``. + .. versionchanged:: 4.1 Support for the ``OpClass()`` expression was added. +.. _operator class: https://www.postgresql.org/docs/current/indexes-opclass.html + ``index_type`` -------------- @@ -147,19 +159,11 @@ For example:: creates an exclusion constraint on ``circle`` using ``circle_ops``. -Alternatively, you can use -:class:`OpClass() ` in -:attr:`~ExclusionConstraint.expressions`:: - - ExclusionConstraint( - name='exclude_overlapping_opclasses', - expressions=[(OpClass('circle', 'circle_ops'), RangeOperators.OVERLAPS)], - ) - -.. versionchanged:: 4.1 +.. deprecated:: 4.1 - Support for specifying operator classes with the ``OpClass()`` expression - was added. + The ``opclasses`` parameter is deprecated in favor of using + :class:`OpClass() ` in + :attr:`~ExclusionConstraint.expressions`. Examples -------- -- cgit v1.3