Tom Lane writes:
> What's bothering me right now is the difference between client and
> server encodings. It seems that the only plausible use for
> octet_length is to do memory allocation on the client side, and for
> that purpose the length ought to be measured in the client encoding.
OCTET_LENGTH returns the size of its argument, not the size of some
possible future shape of that argument. There is absolutely no guarantee
that the string that is processed by OCTET_LENGTH will ever reach any kind
of client. There are procedural languages, for instance, or CREATE TABLE
AS.
Whether or not this behaviour is most likely or most useful is a different
question, but let's not silently readopt standard functions for
non-standard purposes -- we've just gotten past that one.
--
Peter Eisentraut peter_e@gmx.net