Re: "ERROR: operator is not unique" with Custom Data Type - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: "ERROR: operator is not unique" with Custom Data Type
Date
Msg-id 20080605182811.GE16690@svana.org
Whole thread Raw
In response to "ERROR: operator is not unique" with Custom Data Type  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: "ERROR: operator is not unique" with Custom Data Type
List 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@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: "ERROR: operator is not unique" with Custom Data Type
Next
From: "David E. Wheeler"
Date:
Subject: Re: "ERROR: operator is not unique" with Custom Data Type