Re: operator exclusion constraints - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: operator exclusion constraints
Date
Msg-id 87iqd7c43j.fsf@hi-media-techno.com
Whole thread Raw
In response to Re: operator exclusion constraints  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Forgive me if this is discussed before, but why does this store the
> strategy numbers of the relevant operators instead of the operators
> themselves?  It seems like this could lead to surprising behavior if
> the user modifies the definition of the operator class.

Wild guess:
 http://www.postgresql.org/docs/8.4/static/xindex.html
 34.14.2. Index Method Strategies
 The operators associated with an operator class are identified by "strategy numbers", which serve to identify the
semanticsof each operator within the context of its operator class. For example, B-trees impose a strict ordering on
keys,lesser to greater, and so operators like "less than" and "greater than or equal to" are interesting with respect
toa B-tree. Because PostgreSQL allows the user to define operators, PostgreSQL cannot look at the name of an operator
(e.g.,< or >=) and tell what kind of comparison it is. Instead, the index method defines a set of "strategies", which
canbe thought of as generalized operators. Each operator class specifies which actual operator corresponds to each
strategyfor a particular data type and interpretation of the index semantics.
 

Regards,
-- 
dim


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: UTF8 with BOM support in psql
Next
From: Josh Berkus
Date:
Subject: Re: operator exclusion constraints