Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 3793C9FB885 for ; Thu, 1 Mar 2007 21:39:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 50060-10 for ; Thu, 1 Mar 2007 21:38:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id 715289FB86A for ; Thu, 1 Mar 2007 21:38:56 -0400 (AST) Received: from flood.opencloud.co.nz ([192.168.0.31]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1HMwjR-0000Uk-PZ; Fri, 02 Mar 2007 14:38:49 +1300 Message-ID: <45E78066.6000604@opencloud.com> Date: Fri, 02 Mar 2007 14:39:50 +1300 From: Oliver Jowett User-Agent: Thunderbird 1.5.0.9 (X11/20070103) MIME-Version: 1.0 To: Tom Lane CC: Dave Cramer , pgsql-jdbc@postgresql.org Subject: Re: Inserting "null" not working (Sun App Server, Postgres, EJB3)? References: <40939ed60703010604j149caad2n92dccac2ae6f6824@mail.gmail.com> <3AC75FD4-F9DC-4B9E-AA60-38F67EFD39B0@redhat.com> <0DC8A2E6-BB3C-4592-BF9E-7EECA0CCE37B@fastcrypt.com> <23779.1172793964@sss.pgh.pa.us> <26671.1172794578@sss.pgh.pa.us> In-Reply-To: <26671.1172794578@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50 X-Spam-Level: X-Archive-Number: 200703/11 X-Sequence-Number: 16725 Tom Lane wrote: > Dave Cramer writes: >> On 1-Mar-07, at 7:06 PM, Tom Lane wrote: >>> At least in this particular case, leaving the parameter type as >>> UNKNOWN >>> would have worked as the OP wishes. I dunno if that would break other >>> cases though. > >> This means you have to leave all parameter types as UNKNOWN. What's >> the point of having parameter types at all ? > > No, only the ones you do not have any knowledge about. The OP's > complaint is basically that the driver is forcing the parameter type > to "varchar" on the basis of nothing whatsoever. I didn't see the OP say what JDBC calls are being made so I think you're jumping the gun here. If the EJB3 layer is calling something like setString(n, null) then the driver is quite justified in assuming the parameter is varchar. I don't think the driver ever goes from "I don't know the type" to "the type is varchar" .. if anything, it has to do the opposite to deal with applications that think that setString() on a numeric column is a sensible thing to do :( -O