Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lp0eS-0002Gh-Nn for pgsql-general@arkaria.postgresql.org; Fri, 04 Jun 2021 03:37:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lp0eQ-0005jS-T2 for pgsql-general@arkaria.postgresql.org; Fri, 04 Jun 2021 03:37:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lp0eQ-0005jI-K9 for pgsql-general@lists.postgresql.org; Fri, 04 Jun 2021 03:37:38 +0000 Received: from mxg.ryobi.co.jp ([42.127.235.4]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lp0eN-0002AV-3z for pgsql-general@lists.postgresql.org; Fri, 04 Jun 2021 03:37:36 +0000 X-matriXgate-loop-detect: 1749c7a286c7a7589eae2abd190e2b61f585b4b9 Received: from ezEkp3 ([10.50.3.12]) by mxg.ryobi.co.jp with ESMTP; Fri, 04 Jun 2021 12:32:27 +0900 (JST) MIME-Version: 1.0 X-UserIsAuth: true Received: from 10.50.3.61 (EHLO 5103104) ([10.50.3.61]) by ezEkp3 (JMOCHA ESMTP Server) with ESMTPA ID 398592008 for ; Fri, 04 Jun 2021 12:32:27 +0900 (JST) From: =?iso-2022-jp?B?GyRCNVdMZyEhMCYbKEI=?= To: 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> Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AddY2C2RKokWAmknQ1q/axE73+Eymg== Content-Language: ja X-matriXgate-msec-AV: Clean X-matriXgate-Action: Approve X-matriXgate: Policy(Global) X-matriXgate-archive-id: 6a70.6d7a.7f300553f5a0.60b99ffe.71ac0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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