X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 25E78D9A52 for ; Wed, 21 Sep 2005 13:28:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20761-08 for ; Wed, 21 Sep 2005 16:28:42 +0000 (GMT) Received: from gauss.credativ.com (ipx11302.ipxserver.de [212.112.227.254]) by svr1.postgresql.org (Postfix) with ESMTP id 822FBD9945 for ; Wed, 21 Sep 2005 11:15:38 -0300 (ADT) Received: from [10.0.0.49] (LNeuilly-152-22-89-119.w193-251.abo.wanadoo.fr [193.251.34.119]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by gauss.credativ.com (Postfix) with ESMTP id A14A9D764C; Wed, 21 Sep 2005 16:15:39 +0200 (CEST) From: Peter Eisentraut To: Scott Eade Subject: Re: Converting from LATIN1 to UNICODE encoding? Date: Wed, 21 Sep 2005 16:15:21 +0200 User-Agent: KMail/1.8.1 Cc: pgsql-admin@postgresql.org References: <433116DF.7050108@backstagetech.com.au> In-Reply-To: <433116DF.7050108@backstagetech.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509211615.22306.peter_e@gmx.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 required=5 tests=[FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/222 X-Sequence-Number: 18959 Am Mittwoch, 21. September 2005 10:16 schrieb Scott Eade: > Is it necessary for me to convert the database to some other encoding > (e.g. UNICODE) before I can store non-LATIN1 characters or does > PostgreSQL catch these and encode them somehow? Yes and no. > I have actually been attempting to convert a database by doing a pg_dump > (from the LATIN1 database) followed by a pg_restore (to one created with > the UNICODE encoding). That is the right method. > Seemed to work with a sparsely populated 8.0.3 > database, but I am running into all sorts of problems with 7.3.10 (e.g. > corrupted database followed by corrupted pg_clog). That is the symptom of a different, much bigger problem. Encoding problems certainly never corrupt the clog. > What about JDBC, how does it know the encoding of the data I throw at > it? That depends on where your throws come from. As you surely know, Java mostly uses Unicode internally, so the data sent by the JDBC driver to the database is in Unicode, but as to what encoding the data that you input into your Java program has, you need to sort that out with the Java library functions that you use to read that data.