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 3F67F32A465 for ; Wed, 13 Oct 2004 10:29:07 +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 05978-10 for ; Wed, 13 Oct 2004 09:29:01 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 0442E32B464 for ; Wed, 13 Oct 2004 10:29:01 +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 1CHfRL-0004uO-00; Wed, 13 Oct 2004 22:28:59 +1300 Message-ID: <416CF557.2040000@opencloud.com> Date: Wed, 13 Oct 2004 22:28:55 +1300 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: tightening up on use of oid 0 References: <41660A56.5000107@opencloud.com> <4167BC1A.4070809@opencloud.com> <416C3E22.9080605@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: 200410/117 X-Sequence-Number: 11222 Kris Jurka wrote: > Your approach has the benefit of being > fail-fast as adding a new function to the database suddently can't > produce an ambiguity for Java code. Right. The driver cannot guarantee that setNull(i,Types.OTHER) will always be able to infer the right type. It seems safer to me to completely disallow it than have it sometimes succeed and sometimes fail depending on the exact state of the database. It may break older apps, but new apps would be more robust. General question for the list: how much code is out there that performs one of these (equivalent) calls? PreparedStatement.setObject(i, null); PreparedStatement.setObject(i, null, Types.OTHER); PreparedStatement.setNull(i, Types.OTHER); > I don't think it's a common > situation to have overloaded functions that get called with non-typed > nulls, so I wanted to allow it to work as usual for non-ambiguous > cases. After some experimentation, it's not just overloaded functions that are affected. - "? IS NULL" breaks if the parameter is an untyped NULL (this was the original issue -- in an off-list email --that made me look at this area) - Functions taking 'anyarray' or 'anyelement' don't like untyped NULLs, even if they are STRICT (ERROR: could not determine anyarray/anyelement type because input has type "unknown") I'd like to catch those errors earlier than query execution if possible. If nothing else, it'll encourage application developers to provide correct type info to the driver in all cases.. -O