"Joe Conway" <joseph.conway@home.com> writes:
> I was thinking it would be nice to have a
> way to cast bytea into text and vice-versa,
How will you handle a null byte in bytea data? Transforming it directly
into an embedded null in a text object is NOT an acceptable answer,
because too many of the text functions will misbehave on such data.
regards, tom lane