X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A0354D1B45B for ; Tue, 27 Jan 2004 04:33:32 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 75631-04 for ; Tue, 27 Jan 2004 00:33:01 -0400 (AST) Received: from millenium.mst.co.jp (unknown [210.230.185.241]) by svr1.postgresql.org (Postfix) with ESMTP id CE240D1D55F for ; Tue, 27 Jan 2004 00:32:59 -0400 (AST) Received: from mst1x5r347kymb (lc12114 [192.168.1.114]) by millenium.mst.co.jp (8.11.6p2/3.7W) with SMTP id i0R4WqY01862; Tue, 27 Jan 2004 13:32:52 +0900 Message-ID: <001301c3e48e$a00bc240$7201a8c0@mst1x5r347kymb> From: "Iain" To: "Tom Lane" Cc: References: <000901c3e3e6$6cd00060$7201a8c0@mst1x5r347kymb> <8421.1075136755@sss.pgh.pa.us> <000c01c3e47e$8928f1c0$7201a8c0@mst1x5r347kymb> <9716.1075175109@sss.pgh.pa.us> Subject: Re: Can I change the character encoding for a DB? Date: Tue, 27 Jan 2004 13:32:51 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/252 X-Sequence-Number: 12115 Hi Tom, Thanks for that. It's somewhat clearer now. I went ahead and rebuilt the DB with no problems so I guess that whatever data was in the DB converted OK. Regards Iain > "Iain" writes: > > I read the info written by Tasuo, but I have to admit that the whole > > encoding thing is still full of mystery for me. For example, if the database > > has a SQL_ASCII encoding and you enter japanese text, what encoding is used? > > Does it depend on the client used to enter it? > > I'm not an expert on this stuff, but my understanding is that setting > the encoding to SQL_ASCII disables all encoding-conversion logic --- > whatever bytes the client sends are what get stored. So if you want > to change the setting from SQL_ASCII to something else, you'd better be > sure that everything every client has stored is compatible with the new > encoding specification. > > > My understanding is that the DB > > doesn't ensure that data makes sense in the set encoding, > > When you select a real encoding spec (not SQL_ASCII) then the DB does > check that entered strings are valid in that encoding. Also it will > attempt to do encoding conversion, if clients specify they are using > a client_encoding that is different from the database encoding (and > is not SQL_ASCII). > > Hope that helps --- if not, try Tatsuo ... > > regards, tom lane