Re: OCTET_LENGTH is wrong - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: OCTET_LENGTH is wrong
Date
Msg-id 200111211931.fALJVIB02586@candle.pha.pa.us
Whole thread Raw
In response to Re: OCTET_LENGTH is wrong  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
> 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.

Yes, agreed.  I argued that server-side octet_length would be valuable
for server-side functions.  However, others felt client-side was more
important.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: beta3
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: beta3