[HACKERS] ERROR: operator is not unique with Custom Data Type

2008-06-05 Thread David E. Wheeler
Howdy, 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. I'll have more to ask about this later, when I want to get feedback on the implementation. But right now I'm just writing tests

Re: [HACKERS] ERROR: operator is not unique with Custom Data Type

2008-06-05 Thread Martijn van Oosterhout
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

Re: [HACKERS] ERROR: operator is not unique with Custom Data Type

2008-06-05 Thread David E. Wheeler
On Jun 5, 2008, at 11:28, Martijn van Oosterhout wrote: 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

Re: [HACKERS] ERROR: operator is not unique with Custom Data Type

2008-06-05 Thread Tom Lane
David E. Wheeler [EMAIL PROTECTED] writes: On Jun 5, 2008, at 11:28, Martijn van Oosterhout wrote: What would you want postgresql to choose in this case. I was thinking that the ::text should be cast to ::lctext, as that's how `'a'::lctext = 'a'` works, but I keep going back and forth in my

Re: [HACKERS] ERROR: operator is not unique with Custom Data Type

2008-06-05 Thread David E. Wheeler
On Jun 5, 2008, at 11:51, Tom Lane wrote: I was thinking that the ::text should be cast to ::lctext, as that's how `'a'::lctext = 'a'` works, but I keep going back and forth in my mind. Maybe 'a'::lctext should not equal 'A'::text. It seems to me that lctext is sort of like a more-constrained

Re: [HACKERS] ERROR: operator is not unique with Custom Data Type

2008-06-05 Thread Martijn van Oosterhout
On Thu, Jun 05, 2008 at 11:37:28AM -0700, David E. Wheeler wrote: Whichever way you want it, make that direction implicit and the other direction assignment. I'm sure I'm missing something simple here. How do I make it assignment? # \h create cast Command: CREATE CAST Description:

Re: [HACKERS] ERROR: operator is not unique with Custom Data Type

2008-06-05 Thread David E. Wheeler
On Jun 5, 2008, at 14:07, Martijn van Oosterhout wrote: I'm sure I'm missing something simple here. How do I make it assignment? # \h create cast Command: CREATE CAST Description: define a new cast Syntax: snip CREATE CAST (sourcetype AS targettype) WITHOUT FUNCTION [ AS ASSIGNMENT