Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
>> This inconsistency bothers me: I've always thought that char(),
>> varchar(), and text() are functionally interchangeable, but it seems
>> that's not so. Is this behavior mandated by SQL92?
> I haven't found any explicit reference to a distinction between CHAR
> and VARCHAR in the docs nor a discussion of the SQL_TEXT character set
> wrt this topic. So apparently SQL_TEXT properties are implementation
> defined too. But we should look into it more before deciding to change
> anything because afaik the current behavior has been the same in
> Postgres forever...
I'm not necessarily arguing for a change; if you're satisfied that
the existing comparison logic obeys the spec, it's OK with me.
(Ignoring trailing blanks in bpchar does seem reasonable when you
think about it.)
But if it is correct, then we need to turn off oprcanhash for bpchareq.
Odd that no one has noticed this before.
Some doc updates might be in order too...
regards, tom lane