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 CAAA9D1DA7B for ; Tue, 27 Jan 2004 03:45:39 +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 59413-10 for ; Mon, 26 Jan 2004 23:45:12 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id C211DD1D1C4 for ; Mon, 26 Jan 2004 23:45:07 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id i0R3j9nX009717; Mon, 26 Jan 2004 22:45:09 -0500 (EST) To: "Iain" Cc: pgsql-admin@postgresql.org Subject: Re: Can I change the character encoding for a DB? In-reply-to: <000c01c3e47e$8928f1c0$7201a8c0@mst1x5r347kymb> References: <000901c3e3e6$6cd00060$7201a8c0@mst1x5r347kymb> <8421.1075136755@sss.pgh.pa.us> <000c01c3e47e$8928f1c0$7201a8c0@mst1x5r347kymb> Comments: In-reply-to "Iain" message dated "Tue, 27 Jan 2004 11:37:41 +0900" Date: Mon, 26 Jan 2004 22:45:09 -0500 Message-ID: <9716.1075175109@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/251 X-Sequence-Number: 12114 "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