Re: invalidly encoded strings - Mailing list pgsql-hackers

From Tom Lane
Subject Re: invalidly encoded strings
Date
Msg-id 18395.1189541574@sss.pgh.pa.us
Whole thread Raw
In response to Re: invalidly encoded strings  (Tatsuo Ishii <ishii@postgresql.org>)
List pgsql-hackers
Tatsuo Ishii <ishii@postgresql.org> writes:
>> If we make convert() operate on bytea and return bytea, as Tom
>> suggested, would that solve your use case?

> The problem is, the above use case is just one of what I can think of.

> Another use case is, something like this:

> SELECT sum(octet_length(convert(text_column using utf8_to_euc_jp))) FROM mytable;

> to know the total byte length of text column if it's encoded in
> EUC_JP. 

Since octet_length exists and produces identical results for both text
and bytea, this example is hardly very convincing...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump and money type
Next
From: Andrew Dunstan
Date:
Subject: Re: What is happening on buildfarm member dugong