Re: [HACKERS] Casts question

2004-06-22 Thread Shachar Shemesh
Tom Lane wrote: Shachar Shemesh [EMAIL PROTECTED] writes: Tom Lane wrote: Yes, it can cast to varchar, but that doesn't help because there are no varchar operators ;-). To resolve the operator, it has to promote both sides to text, and you didn't offer a cast to text. I don't get

Re: [HACKERS] Casts question

2004-06-22 Thread Tom Lane
Shachar Shemesh [EMAIL PROTECTED] writes: What I don't understand is this. The cast from varchar to text is a no-function one. I.e. - they are defined to be memory-represented the same. If that is the case, one would expect them to also share the input and ouput functions. When looking at

Re: [HACKERS] Casts question

2004-06-20 Thread Shachar Shemesh
Tom Lane wrote: Shachar Shemesh [EMAIL PROTECTED] writes: I have defined a datatype called varcharci, shamelessly yanking the input, output, recv and send functions from varchar. This means (as far as I understand things) that this type is binary compatible with varchar. Use text, not

Re: [HACKERS] Casts question

2004-06-20 Thread Tom Lane
Shachar Shemesh [EMAIL PROTECTED] writes: Tom Lane wrote: Yes, it can cast to varchar, but that doesn't help because there are no varchar operators ;-). To resolve the operator, it has to promote both sides to text, and you didn't offer a cast to text. I don't get it. When we look to see

Re: [HACKERS] Casts question

2004-06-18 Thread Tom Lane
Shachar Shemesh [EMAIL PROTECTED] writes: I have defined a datatype called varcharci, shamelessly yanking the input, output, recv and send functions from varchar. This means (as far as I understand things) that this type is binary compatible with varchar. Use text, not varchar. Why is