| От | Tom Lane |
|---|---|
| Тема | Re: Custom types and array equality |
| Дата | |
| Msg-id | 20985.1161402012@sss.pgh.pa.us обсуждение |
| Ответ на | Custom types and array equality (Morgan Kita <mkita@verseon.com>) |
| Список | pgsql-general |
Morgan Kita <mkita@verseon.com> writes:
> This should be a relatively simple question... I just made a custom type
> in C, which I will use to build an array in one of my tables. ...
> However, should array_eq be called for unique constraints? What am I
> missing here to get this system working?
array_eq couldn't care less whether you have an operator named '='.
What it wants to find is a default btree index opclass for your datatype.
That represents an actual assertion that the operators behave in a
certain way, whereas an operator merely named '=' might do anything.
There's a fair amount of other infrastructure that also relies on
btree opclasses to tell it how operators behave, so it's worth your
trouble to jump through this hoop.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера