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 7BC34329DF7 for ; Thu, 23 Sep 2004 01:29:57 +0100 (BST) 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 90693-01 for ; Thu, 23 Sep 2004 00:29:48 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 263D6329D95 for ; Thu, 23 Sep 2004 01:29:51 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CAHUb-0003i6-00; Thu, 23 Sep 2004 12:29:49 +1200 Message-ID: <415218FC.9010801@opencloud.com> Date: Thu, 23 Sep 2004 12:29:48 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: "pgsql-jdbc@postgresql.org" Subject: Re: Detecting SQL_ASCII databases References: <414CB84A.2050107@opencloud.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/155 X-Sequence-Number: 11045 Kris Jurka wrote: > > On Sun, 19 Sep 2004, Oliver Jowett wrote: > > >>8.0 backends report the server_encoding value of the database via >>ParameterStatus during startup. I'd like to use this to detect SQL_ASCII >>databases and complain loudly. > > > That would certainly help people who have setup their databases > incorrectly, but it is actually legal to have a setup like this as long as > you only use seven bit ascii characters. We could support this case by requiring charSet=SQL_ASCII to be specified if you have this case. (this would set client_encoding = SQL_ASCII and interpret data as US-ASCII). Part of the problem is that SQL_ASCII seems to mean "just store whatever I'm given directly"; there is no real "7-bit ascii only" encoding? > I'm not sure where I stand on > this. There are probably plenty of databases that are working fine with > the current setup. For example even using 8 bit chars in a SQL_ASCII > database, if all clients are unicode then the only problem you'll see is > the length check in something like varchar(100) failing. We could support this with charSet=UNICODE (set client_encoding = SQL_ASCII and interpret data as UTF-8) -O