M Sarwar <sarwarmd02(at)outlook(dot)com> writes:
> I expect this to behave the same way whether it comes from CHAR or VARCHAR.
You expect incorrectly. CHAR comparison is insensitive to trailing
spaces:
https://stream.boxwatch.ru/docs/current/datatype-character.html
regards, tom lane