Search Postgresql Archives

bytea to varchar using different charsets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

i would like to write a PL/PGSQL function to convert a bytea into a varchar 
using the character maps GSM 03.38 
(http://en.wikipedia.org/wiki/Short_message_service) and ISO 8859-1 
(http://en.wikipedia.org/wiki/Iso_8859-1#ISO-8859-1).
The first approach would be to loop through the bytes and map each of them to 
a character and thus build up the string. The question is if there already 
exists such a functionality or how the mapping could be done in an elegant 
way. What i found was 
convert(string using conversion_name) from 
http://www.postgresql.org/docs/8.2/static/functions-string.html with the 
various Built-in Conversions and 
chr(int) which is only available for the ASCII charset.

thx,
Peter


-- 
Peter Bauer
APUS Software G.m.b.H.
A-8074 Raaba, Bahnhofstrasse 1/1
Email: peter.bauer@xxxxxxxxxx
Tel: +43 316 401629 24
Fax: +43 316 401629 9

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux