select length('aa '::varchar(6)); //answers 6
select char_length('aa '::varchar(6)); //answers 6
select char_length('aa '::char(6)); //answers 2 even though the input string has 6 characters as was the case with the varchar input string
select length('aa '::char(6)); //answers 2 even though the input string has 6 characters as was the case with the varchar input string
are the results as expected? the last two strike me as unexpected