X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 774ED3A43D9 for ; Thu, 4 Nov 2004 10:15:41 +0000 (GMT) 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 90388-09 for ; Thu, 4 Nov 2004 10:15:33 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 2A1633A3FF9 for ; Thu, 4 Nov 2004 10:15:32 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.21]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CPeeN-0005u8-00; Thu, 04 Nov 2004 23:15:27 +1300 Message-ID: <418A01B2.70104@opencloud.com> Date: Thu, 04 Nov 2004 10:17:22 +0000 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: mbch67@yahoo.com Cc: pgsql-jdbc@postgresql.org Subject: Re: 8.0.0beta4: "copy" and "client_encoding" References: <41893BC8.6000201@opencloud.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=MAILTO_TO_SPAM_ADDR X-Spam-Level: * X-Archive-Number: 200411/53 X-Sequence-Number: 11475 mbch67@yahoo.com wrote: > Thanks Kris and Oliver for your explanations. > > Why I want to set the client_encoding to latin1? That's a fair > question. Unfortunately I removed the statement following the COPY > command to keep the posting short: > > SET CLIENT_ENCODING TO 'LATIN1'; > COPY temp_test FROM '/home/postgres/temp_test.dat'; > > I want to load a latin1-encoded file using the COPY command. Hmm. I am suprised that COPY does not let you specify the encoding of the input file. Using client_encoding for this seems wrong: there are some cases it can't handle, e.g. trying to load a LATIN1-encoded file into a table that has a name that can't be represented in LATIN1. I suppose that in the absence of backend support for this, we could add some URL parameter that allows client_encoding to be changed, with suitably dangerous warnings around using it. Then you can temporarily flip client_encoding to LATIN1 for the duration of the COPY, and revert it to UNICODE afterwards. -O