john snow <ofbizfanster@gmail.com> writes:
> as well as select length('aa'::char(6));
> i thought if the string to be stored is shorter than specified length , it
> will be padded with spaces?
It *is* padded, as you can verify with other functions such as
octet_length or pg_column_size. But length() disregards trailing
spaces in char-type values, on the theory that they're semantically
insignificant.
regards, tom lane