We have had a couple of threads recently on improving
bpchar/varchar/text behavior by making bpchar-to-text promotion
go through rtrim() (instead of being a straight binary-compatible
conversion) and getting rid of redundant operators:
http://archives.postgresql.org/pgsql-hackers/2002-11/msg00703.php
http://archives.postgresql.org/pgsql-performance/2003-05/msg00151.php
I'm going to go ahead and make these changes for 7.4, as they will
clearly improve the intuitiveness of the behavior. I don't think they
move us any closer to spec compliance --- the spec appears to require
a notion of a collation sequence that can be specified independently
of the character datatype, which is something we don't have and aren't
likely to have very soon. (It's not clear to me that it's actually
*useful* to specify NO PAD collation with fixed-width character data,
or PAD SPACE with varchar data, but the spec lets you do it.) In the
meantime though these changes seem to be a win, and they will not leave
us any worse off when we do get around to implementing collations.
We speculated about a couple of alternative solutions in the first of
the above-mentioned threads, but they didn't look nearly as practical
to implement as this way.
Last call for objections ...
regards, tom lane