Re: text and bytea - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: text and bytea
Date
Msg-id 20080225073902.GB31692@svana.org
Whole thread Raw
In response to Re: text and bytea  ("hernan gonzalez" <hgonzalez@gmail.com>)
Responses Re: text and bytea
List pgsql-general
On Fri, Feb 22, 2008 at 01:54:46PM -0200, hernan gonzalez wrote:
> >  It seems to me that postgres is trying to do as you suggest: text is
> >  characters and bytea is bytes, like in Java.
>
> But the big difference is that, for text type, postgresql knows "this
> is a text" but doesnt know the encoding, as my example showed. This
> goes against the concept of "text vs bytes" distintion, which per se
> is very useful and powerful (specially in this Unicode world) and
> leads to a dubious/clumsy string api (IMHO, as always).

Umm, I think all you showed was that the to_ascii() function was
broken. Postgres knows exactly what encoding the string is in, the
backend encoding: in your case UTF-8.

Now, it would be nice if postgres could handle other encodings in the
backend, but there's no agreement on how to implement that feature so
it isn't implemented.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Attachment

pgsql-general by date:

Previous
From: Stuart Brooks
Date:
Subject: autovacuum not freeing up unused space on 8.3.0
Next
From: danmcb
Date:
Subject: Re: request help forming query