From: | Michael Enke <michael(dot)enke(at)wincor-nixdorf(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | CREATE CHARSET would be nice feature |
Date: | 2008-05-05 14:41:20 |
Message-ID: | 481F1C90.90708@wincor-nixdorf.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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
Geschftsfhrer: Eckard Heidloff (Vorsitzender), Stefan Auerbach, Dr. Jrgen Wunram
Vorsitzender des Aufsichtsrats: Karl-Heinz Stiller
Steuernummer: 339/5884/0020 - Ust-ID Nr.: DE812927716 - WEEE-Reg.-Nr. DE44477193
Diese E-Mail enthlt vertrauliche Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtmlich 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Marlowe | 2008-05-05 15:01:21 | Re: COPY Performance |
Previous Message | David Fetter | 2008-05-05 14:33:30 | Re: operator varchar = integer |