Stefano Reksten <sreksten (AT) sdb (DOT) it> writes:
Quote:
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
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq