Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Custom types and array equality


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: mkita(at)verseon(dot)com
  • Cc: pgsql-general(at)postgresql(dot)org
  • Subject: Re: Custom types and array equality
  • Date: Fri, 20 Oct 2006 23:40:12 -0400
  • Message-id: <20985(dot)1161402012(at)sss(dot)pgh(dot)pa(dot)us>

Morgan Kita <mkita(at)verseon(dot)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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group