Unix Technical Forum

CREATE CHARSET would be nice feature

This is a discussion on CREATE CHARSET would be nice feature within the Pgsql General forums, part of the PostgreSQL category; --> Hi all, I had to get data out of postgresql in CP852 encoding (internally stored in UNICODE). So I ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-07-2008, 11:17 AM
Michael Enke
 
Posts: n/a
Default CREATE CHARSET would be nice feature

Hi all,
I had to get data out of postgresql in CP852 encoding (internally stored in UNICODE).
So I wrote my own encoding function and used CREATE DEFAULT ENCODING.
The problem with this is:
I can only use character set names which are known internally.
So I "misused" the LATIN2:

update pg_conversion set condefault=false where conname='iso_8859_2_to_utf8';
update pg_conversion set condefault=false where conname='utf8_to_iso_8859_2';
CREATE DEFAULT CONVERSION utf82cp852 FOR 'UNICODE' TO 'LATIN2' FROM utf82cp852;
CREATE DEFAULT CONVERSION cp8522utf8 FOR 'LATIN2' TO 'UNICODE' FROM cp8522utf8;

I do not understand why there is a CREATE CONVERSION without a CREATE CHARSET
since everybody using it has to misuse existing charset names.

So, a nice feature would be to let user create their own character set names.
In this case I could write:
CREATE CHARSET CP852;
CREATE DEFAULT CONVERSION utf82cp852 FOR 'UNICODE' TO 'CP852' FROM utf82cp852;
CREATE DEFAULT CONVERSION cp8522utf8 FOR 'CP852' TO 'UNICODE' FROM cp8522utf8;
and I would not need to update the pg_conversion table and I would be able
to use LATIN2 and CP852 in parallel.

Are there actually plans for this?

If this is not the case, is there a table which maps values for
pg_conversion.conforencoding / pg_conversion.contoencoding
to the names given as source_encoding/dest_encoding and where I can add one row?

Regards,
Michael

--
Wincor Nixdorf International GmbH
Sitz der Gesellschaft: Paderborn
Registergericht Paderborn HRB 3507
Geschäftsführer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. Jürgen Wunram
Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller
Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193

Diese E-Mail enthält vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.

This e-mail may contain confidential information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:59 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com