Re: "ERROR: operator is not unique" with Custom Data Type

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "ERROR: operator is not unique" with Custom Data Type
Date: 2008-06-05 18:28:11
Message-ID: 20080605182811.GE16690@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 05, 2008 at 11:18:26AM -0700, David E. Wheeler wrote:
> I'm working on a custom data type based on TEXT that does case-
> insensitive, locale-aware comparisons, essentially by calling LOWER()
> to compare values.

What makes this different from the citext project?

> However, thanks to the implicit cast PostgreSQL finds more than one
> candidate operator when I compare properly casted values:
>
> try=# select 'a'::lctext = 'a'::text;
> ERROR: operator is not unique: lctext = text
> LINE 1: select 'a'::lctext = 'a'::text;
> ^

What would you want postgresql to choose in this case. Whichever way
you want it, make that direction implicit and the other direction
assignment. Having A->B and B->A both as implicit just leads to
ambiguity.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2008-06-05 18:37:28 Re: "ERROR: operator is not unique" with Custom Data Type
Previous Message David E. Wheeler 2008-06-05 18:18:26 "ERROR: operator is not unique" with Custom Data Type