Search Postgresql Archives

Re: pg_dumpall: pg_conversion table not saved

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

 



Tom Lane schrieb:
> Michael Enke <michael.enke@xxxxxxxxxxxxxxxxxx> 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 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.

Attachment: libencodings.so
Description: application/sharedlib


[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