Re: OCTET_LENGTH is wrong - Mailing list pgsql-hackers

From Tom Lane
Subject Re: OCTET_LENGTH is wrong
Date
Msg-id 24874.1006369239@sss.pgh.pa.us
Whole thread Raw
In response to OCTET_LENGTH is wrong  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: OCTET_LENGTH is wrong
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane writes:
>> What's bothering me right now is the difference between client and
>> server encodings.

> OCTET_LENGTH returns the size of its argument, not the size of some
> possible future shape of that argument.

That would serve equally well as an argument for returning the
compressed length of the string, I think.  You'll need to do better.

My take on it is that when a particular client encoding is specified,
Postgres does its best to provide the illusion that your data actually
is stored in that encoding.  If we don't make OCTET_LENGTH agree, then
we're breaking the illusion.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: OCTET_LENGTH is wrong
Next
From: Peter Eisentraut
Date:
Subject: Re: OCTET_LENGTH is wrong