Re: OCTET_LENGTH is wrong

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Barry Lind <barry(at)xythos(dot)com>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: OCTET_LENGTH is wrong
Date: 2001-11-21 18:55:20
Message-ID: Pine.LNX.4.30.0111202251220.613-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

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(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-11-21 19:00:39 Re: OCTET_LENGTH is wrong
Previous Message Peter Eisentraut 2001-11-21 18:55:07 Re: postgresql.conf (Proposed settings)