Re: pg_dumpall: pg_conversion table not saved

Поиск
Список
Период
Сортировка
От Michael Enke
Тема Re: pg_dumpall: pg_conversion table not saved
Дата
Msg-id 48224ADF.8060307@wincor-nixdorf.com
обсуждение исходный текст
Ответ на Re: pg_dumpall: pg_conversion table not saved  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane schrieb:
> Michael Enke <michael.enke@wincor-nixdorf.com> writes:
>> I updated pg_converion to set the condefault=false where I need it.
>
> Why are you needing to replace an existing default conversion?
> Do we have a bug in it?

No, not a bug. But I need CP852 encoding conversion. Maybe you can take a look at
http://archives.postgresql.org/pgsql-general/2008-05/msg00185.php
and give your comment.

Is the CREATE CONVERSION only for the case that there is a bug in existing default conversions? ;-)

>> pg_dumpall does NOT write that table out and therefore it is not possible to restore, this update get lost.
>
> pg_dump does not (and shouldn't) dump system-defined objects.  It has
> no way to know that you modified the definition of such an object.
>
>> Why can not the "CREATE DEFAULT CONVERSION ..."
>>       a) return with an error if there is another default conversion existing or
>
> AFAICS it does.

You can try with attached library:

   CREATE FUNCTION utf82cp852(integer,integer,cstring,internal,integer)
   RETURNS void AS '/tmp/libencodings' LANGUAGE 'C';
   CREATE FUNCTION cp8522utf8(integer,integer,cstring,internal,integer)
   RETURNS void AS '/tmp/libencodings' LANGUAGE 'C';

   CREATE DEFAULT CONVERSION utf82cp852 FOR 'UNICODE' TO 'LATIN2' FROM utf82cp852;
   CREATE DEFAULT CONVERSION cp8522utf8 FOR 'LATIN2' TO 'UNICODE' FROM cp8522utf8;

It doesn't complain but it also is not the encoding used now
since utf8_to_iso_8859_2 / iso_8859_2_utf8 has still condefault=true.
If I now set condefault to false, my conversion function is used.

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 по дате отправления:

Предыдущее
От: xaviergxf
Дата:
Сообщение: TSearch2 Searching Text with Synonyms and Stop Dictionary
Следующее
От: "William Temperley"
Дата:
Сообщение: statistics collector process is thrashing my cpu