Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> I just noticed that comparing a text to a varchar results in an index not
> being used without a cast in some circumstances. Given that they have
> identical internal representations (or so I believe), that seems a little odd.
But they're not the same datatype.
I have been wondering whether we couldn't eliminate the datatype
distinction between text and varchar. Haven't gotten around to thinking
about it though; the mess in the numeric-datatype world seems higher
priority.
regards, tom lane