The following bug has been logged on the website:
Bug reference: 14800
Logged by: Артём Костин
Email address: kostin(dot)artem(at)gmail(dot)com
PostgreSQL version: 9.4.11
Operating system: Win 10
Description:
These two commands produce different results with similar types
select substring(cast(' 2345 ' as character(16)), 1, 7) || '?',
substring(cast(' 2345 ' as varchar(16)), 1, 7) || '?';
" 2345?";" 2345 ?"
Should it work in this way or not?