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 F3681EAE575 for ; Sat, 23 Oct 2004 21:44:24 +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 39609-04 for ; Sat, 23 Oct 2004 20:44:34 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 5917FEAE55E for ; Sat, 23 Oct 2004 21:44:18 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CLSki-0000Wy-00; Sun, 24 Oct 2004 09:44:41 +1300 Message-ID: <417AC2C2.40605@opencloud.com> Date: Sun, 24 Oct 2004 09:44:50 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.8 (X11/20041021) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Kris Jurka , Dave Smith , pgsql-jdbc@postgresql.org Subject: Re: Problem with fixed length fields. References: <1098532450.2684.3.camel@davehome> <26657.1098556819@sss.pgh.pa.us> In-Reply-To: <26657.1098556819@sss.pgh.pa.us> X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime 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=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/245 X-Sequence-Number: 11350 Tom Lane wrote: > Kris Jurka writes: > >>This is a problem with the driver because it is typing the ' ' values as >>text, not char, so the comparison doesn't work right because these two >>types handle trailing spaces differently. > > > Can you refrain from assigning a type at all? People writing the > equivalent SQL directly would almost always write 'foo', not > 'foo'::text or 'foo'::char. The parser's behavior has been tuned > so that that usually works nicely. We've been trying to avoid that as there is currently no statement Describe issued by the driver, so we'd run the risk that the parser would infer something completely unexpected from the driver's point of view. Also, we'd need the Describe to get useful information on when a named statement can be safely reused (the driver currently gets this wrong anyway, but it's fixable without needing a Describe as it stands). Adding the Describe would add a round-trip to every query that involved an unknown type. Pushing on blindly with a Bind without knowing the actual type of the parameters you're sending seems possible but dangerous. It'd preclude using binary-format parameters for unknown types, at a minimum. -O