Stefano Reksten <sreksten@sdb.it> writes:
> SELECT length(name), name from test;
> length | name
> --------+------------
> 4 | test
> Should not a char(10) insert 6 padding spaces?
It does, as you can see in the above output; but the padding spaces are
considered semantically insignificant and are therefore ignored by
length() and by concatenation. If you think that trailing spaces are
meaningful data, then use varchar(n) or text.
regards, tom lane