Kristo Kaiv <kristo.kaiv@skype.net> writes:
> During development i stumbled upon a strange behaviour in 8.2.4
> ...
> Why is this still blank padded? Shouldn't a character(20) -> text
> conversion
> happen implicitly when the value is selected into the return type
> that is declared as text?
No, that's not how plpgsql deals with forced type conversions.
Its method is always "run the source type's output function, then
feed that to the destination type's input function". In some cases
that will yield different behavior than a SQL cast.
regards, tom lane