Please tell me about character code conversion.

Поиск
Список
Период
Сортировка
От 久門 愛
Тема Please tell me about character code conversion.
Дата
Msg-id 002f01d758f2$3e139680$ba3ac380$@ryobi.co.jp
обсуждение исходный текст
Ответы Re: Please tell me about character code conversion.
Список pgsql-general
Hi,
Please tell me about character code conversion.
I am currently using Postgres 13.3.
I would like to set my own character code conversion as DEFAULT CONVERSION.
Since there is a CONVERSION provided by Postgres by default, the following
error will occur when executing CREATE CONVERSION.
-----------------------------
postgres=# CREATE DEFAULT CONVERSION pg_catalog.myconv_sjis_to_utf8 FOR
'SJIS' TO 'UTF8' FROM myconv_sjis_to_utf8;
ERROR:  default conversion for SJIS to UTF8 already exists 
postgres=#
-----------------------------

As a method to change the conversion provided by default, execute the
following SQL statement and after executing CREATE CONVERSION
I am trying to update the system catalog with an UPDATE statement. Is there
any problem with this method?
-----------------------------
CREATE CONVERSION pg_catalog.myconv_sjis_to_utf8 FOR 'SJIS' TO 'UTF8' FROM
myconv_sjis_to_utf8; 
UPDATE pg_conversion SET condefault='f' WHERE conname='sjis_to_utf8'; 
UPDATE pg_conversion SET condefault='t' WHERE conname='myconv_sjis_to_utf8';
-----------------------------

Thanks
Ai





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

Предыдущее
От: saket bansal
Дата:
Сообщение: Noinheritance with superuser
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Noinheritance with superuser