X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A4B289DCAC9 for ; Wed, 8 Feb 2006 05:34:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97113-02 for ; Wed, 8 Feb 2006 05:34:18 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (serval.logix-tt.com [213.239.221.42]) by postgresql.org (Postfix) with ESMTP id CA2B59DCA44 for ; Wed, 8 Feb 2006 05:34:14 -0400 (AST) Received: from kingfisher.intern.logix-tt.com (Mede3.m.pppool.de [89.49.237.227]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id B08C424400F; Wed, 8 Feb 2006 10:34:18 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 2896818151EB3; Wed, 8 Feb 2006 10:34:19 +0100 (CET) Message-ID: <43E9BB1B.2070207@logix-tt.com> Date: Wed, 08 Feb 2006 10:34:19 +0100 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Cc: Matthew Bellew Subject: Re: Inconsistent casting with literal vs parameter References: <43E91EFA.4080106@bellew.net> <43E9265E.3070209@bellew.net> <43E9344C.2060805@bellew.net> <43E93867.2050805@bellew.net> In-Reply-To: <43E93867.2050805@bellew.net> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.122 required=5 tests=[AWL=0.122] X-Spam-Score: 0.122 X-Spam-Level: X-Archive-Number: 200602/52 X-Sequence-Number: 14649 Hi, Matthew, Matthew Bellew wrote: > My last 2 cents on the whole topic. There is a fundamental design issue > here with deciding to handle the expression /column < > (value/literal/parameter typed or not)/ by converting the column to a > string. Obviously, with INSERT INTO the data values must be coerced to > the destination column type. In this case, while there is a > parsing/optimizing decision to be made, it should be made with a strong > bias to convert to the column type (and then handling any tricky > coercion failures or optimization issues). The problem is that you explicitly send the parameter as a String to the server, so it gets the bias to coerce the column to the string. However, you can always make shure the parameters are compared set correctly by explicityl casting them: SELECT * FROM floats WHERE x<(?::double precision); or SELECT * FROM floats WHERE x