Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 766009FA4D8 for ; Thu, 1 Mar 2007 20:07:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 50590-04 for ; Thu, 1 Mar 2007 20:07:33 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 843F89FA43F for ; Thu, 1 Mar 2007 20:07:37 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l22064l8023780; Thu, 1 Mar 2007 19:06:04 -0500 (EST) To: Dave Cramer cc: pgsql-jdbc@postgresql.org Subject: Re: Inserting "null" not working (Sun App Server, Postgres, EJB3)? In-reply-to: <0DC8A2E6-BB3C-4592-BF9E-7EECA0CCE37B@fastcrypt.com> References: <40939ed60703010604j149caad2n92dccac2ae6f6824@mail.gmail.com> <3AC75FD4-F9DC-4B9E-AA60-38F67EFD39B0@redhat.com> <0DC8A2E6-BB3C-4592-BF9E-7EECA0CCE37B@fastcrypt.com> Comments: In-reply-to Dave Cramer message dated "Thu, 01 Mar 2007 18:35:32 -0500" Date: Thu, 01 Mar 2007 19:06:04 -0500 Message-ID: <23779.1172793964@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.06 tagged_above=0 required=5 tests=AWL, BAYES_50, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200703/7 X-Sequence-Number: 16721 Dave Cramer writes: > The reason that setNull is required is because the type information > is required. NULL by it self has no type information. The jdbc driver > binds values to a prepared statement and the type information is > required. So setNull( n, typeinfo) is required to bind the correct type. 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. regards, tom lane