| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Shachar Shemesh <psql(at)shemesh(dot)biz> |
| Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Casts question |
| Date: | 2004-06-18 16:09:58 |
| Message-ID: | 21241.1087574998@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Shachar Shemesh <psql(at)shemesh(dot)biz> 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 that? Being as it is that no operator = is defined for varcharci,
> and that the cast from varchar to varcharci is "as assignment" anyways,
> shouldn't postgres be able to do the cast implicitly?
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.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2004-06-18 17:11:19 | Re: specifying multiple result format codes with libpq |
| Previous Message | Tom Lane | 2004-06-18 16:00:10 | Re: Using domains for case insensitivity |