Joe Conway <mail@joeconway.com> writes:
> In other words, when you insert ' ' into string1postgres.a3pattern,
> which is defined as char(15), the single space is trimmed leaving an
> empty string:
> test=# select '***' || a3pattern || '!!!' from string1postgres;
> ?column?
> ----------
> ***!!!
> (1 row)
Actually, I believe the space-trimming happens when the char(n) value
is coerced to type text in preparation for passing it to the || operator
(which takes text). Since trailing spaces are considered insignificant
in char(n), whereas they definitely are significant in text, this is a
reasonable thing to do, at least in some contexts.
regards, tom lane