pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 久門 愛瘢雹 <kumon.ai@ryobi.co.jp>
To: pgsql-general@lists.postgresql.org
Subject: Please tell me about character code conversion.
Date: Fri, 4 Jun 2021 12:32:27 +0900
Message-ID: <002f01d758f2$3e139680$ba3ac380$@ryobi.co.jp> (raw)

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







view thread (2+ messages)  latest in thread

Message-ID: <002f01d758f2$3e139680$ba3ac380$@ryobi.co.jp>
Permalink:  ../002f01d758f2$3e139680$ba3ac380$@ryobi.co.jp/
Also on:    postgresql.org/message-id/002f01d758f2$3e139680$ba3ac380$@ryobi.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: kumon.ai@ryobi.co.jp
  Subject: Re: Please tell me about character code conversion.
  In-Reply-To: <002f01d758f2$3e139680$ba3ac380$@ryobi.co.jp>
  References: <002f01d758f2$3e139680$ba3ac380$@ryobi.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox