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 045F132AC97 for ; Tue, 12 Oct 2004 21:27:22 +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 09846-06 for ; Tue, 12 Oct 2004 20:27:19 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id A3EE132A8A1 for ; Tue, 12 Oct 2004 21:27:20 +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 1CHTEq-0003GA-00; Wed, 13 Oct 2004 09:27:16 +1300 Message-ID: <416C3E22.9080605@opencloud.com> Date: Wed, 13 Oct 2004 09:27:14 +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> 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/112 X-Sequence-Number: 11217 Kris Jurka wrote: > > On Sat, 9 Oct 2004, Oliver Jowett wrote: > > >>Oliver Jowett wrote: >> >>>I am currently cleaning up a few places where OID 0 could get used as a >>>parameter type (causing the backend to try to infer a type). >> >>Here is a patch to do this, including the PGobject changes to handle SQL >>NULLs. >> > > > What I was suggesting before was a means to allow users to specify a pg > type for the Types.OTHER case, but not to require it. I don't see the > danger in allowing OID 0 in this case. Ah, I thought you were OK with disallowing setNull(Types.OTHER) entirely, I must have misunderstood what you said earlier. I described one problem with allowing it in an earlier email: >> Consider the case where you have two functions: >> >> foo(line) >> foo(box) >> >> Executing "SELECT foo(?)" via PreparedStatement will work fine if you pass a non-null PGline or PGbox argument to setObject, but if you try to setNull() then you will get ambiguity between the two functions at execution time. That's quite unpredictable behaviour. > I know you are after complete > strong typing, but I don't see the benefit while I do see the drawback. What is the drawback? The only case that will change is the case that is currently ambiguous. And there is a fairly simple mechanism for disambiguating it via PGobject. -O