Re: < operator for user-defined types

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: < operator for user-defined types
Дата
Msg-id 11453.1080228568@sss.pgh.pa.us
обсуждение исходный текст
Ответ на < operator for user-defined types  (Teodor Sigaev <teodor@sigaev.ru>)
Список pgsql-hackers
Teodor Sigaev <teodor@sigaev.ru> writes:
> So, I must declare b-tree opclass for tsvector. Why?
> My supposition is to guarantee that operator < is really 'less-than'
> one. Is it?

Exactly.  We used to assume that any operator named '<' would be
suitable for sorting, but it's a lot safer to assume that an operator
associated with a b-tree opclass behaves in the right way.  Also there
are some optimizations possible as a result.  (It turns out that the
sorting code will end up using the comparison support function for the
opclass, and not the operator per se, because that way we only need one
function call per comparison.  Using the operator, we'd often need two
calls.)
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: Email addresses on developer bios site
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: pg_advisor schema proof of concept