CREATE CHARSET would be nice feature

Поиск
Список
Период
Сортировка
От Michael Enke
Тема CREATE CHARSET would be nice feature
Дата
Msg-id 481F1C90.90708@wincor-nixdorf.com
обсуждение исходный текст
Список 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
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
erhaltenhaben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie
dieunbefugte 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
inerror) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distributionof the material in this e-mail is strictly forbidden. 


В списке pgsql-general по дате отправления:

Предыдущее
От: "Leandro Casadei"
Дата:
Сообщение: Extract only numbers from a varchar column
Следующее
От: "Javier Olazaguirre"
Дата:
Сообщение: Re: Speed up repetitive queries