Markus Schaber wrote:
Hi, Eugene,
Eugene E. wrote:
Okay, now pass that to strcmp or a %s format. AFAIK, the
"textual-form" of
values is meant to be a c-string. "ab\0cd\0" is not a c-string containing
ab\0cd, it's a c-string containing ab.
WHY strcmp ?! do you really think the user is a fool ?
if the user declared something "binary", he obviously knows what he has
done.
But when the user requests the canonical _text_ representation of a byte
area data type, why do you consider him declaring it "binary"?
he did not request this representation. it is _by_default_
if you wish to provide it by request, please do it.
i ask you to provide minimal convertion by default, mentioned the user
wants his data unchanged.
and let the user interpret his own data himself.
Since this structure provides a length of each value, you have no need
in c-string. Why do think the user needs it ?
A user that does not have a need in C-Strings can fetch the binary
representation, getting higher efficency for all datatypes.
and lose the pretty good representation of all other columns in the same
request.
"textual-form" is just a name of actually existent convertion rule.
i am not trying to find out a philosophy here.
There is no philosophy but orthogonality.
There's a textual and a binary form of datatypes. For varchar, byta,
int4, float, PostGIS geometries etc...
good. i ask you to slightly change "textual" representation of bytea.
The text representation is pretty useful for human readers for _most_
datatypes, the binary representation is much easier to parse for programs.
You are right.
but
Who said that i can not display something ?
i thougth, human-readability of some data depends completely on how
CLIENT-SIDE interpret it.
server do not know and should not know
what data is human readable or printable... etc.
So use the binary representation for everything if you don't want to
display the data to the user directly.
The problem we discuss is not about displaing or printig at all.
Some applications want "textual-form" -- most applications
but not only to display
and in the _same_ query the same applications want bytea...
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org