Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 2D016914537 for ; Thu, 1 Dec 2011 09:40:11 -0400 (AST) Received: from mail-yx0-f174.google.com ([209.85.213.174]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RW6rw-000230-91 for pgsql-jdbc@postgresql.org; Thu, 01 Dec 2011 13:40:10 +0000 Received: by yenl6 with SMTP id l6so1662762yen.19 for ; Thu, 01 Dec 2011 05:39:53 -0800 (PST) Received: by 10.236.161.103 with SMTP id v67mr11297181yhk.87.1322746793633; Thu, 01 Dec 2011 05:39:53 -0800 (PST) Received: from ayaki.localdomain (124-169-45-65.dyn.iinet.net.au. [124.169.45.65]) by mx.google.com with ESMTPS id l27sm15313917ani.21.2011.12.01.05.39.48 (version=SSLv3 cipher=OTHER); Thu, 01 Dec 2011 05:39:50 -0800 (PST) Message-ID: <4ED783A1.4040609@ringerc.id.au> Date: Thu, 01 Dec 2011 21:39:45 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: Oliver Jowett CC: Mikko Tiihonen , bht@actrix.gen.nz, pgsql-jdbc@postgresql.org Subject: Re: Bug: Cannot pass null in Parameter in Query for ISNULL References: <6ekbd7dm4d6su5b9i4hsf92ibv4j76n51f@4ax.com> <4ED74716.7070904@nitorcreations.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201112/5 X-Sequence-Number: 22459 On 12/01/2011 05:38 PM, Oliver Jowett wrote: > On 1 December 2011 22:21, Mikko Tiihonen > wrote: > >> So far it has been established that the JPA implementation you are >> using uses an unportable hack that happens to work for some DB vendors >> but not with postgresql. > > While we're at it - what is the JPA implementation in question? I'd be interested too, as I've had no issues related to null handling using EclipseLink or Hibernate (3 and 4) with PostgreSQL. (on a side-note): I *have* had annoying issues working with the `xml' datatype (and other text-like types) where I'd like to work with them as String in Java. This is really a JPA deficiency as much as a PgJDBC one, in that JPA doesn't really offer a way to say "this is the Java type, but please use this other SQLTYPE when passing it to the JDBC driver". The JPA implementation would use setString(...) instead of setObject(...) with the SQLXML type constant, and Pg would refuse to accept a `text' value for an `xml' field. I kind of wish there was an implicit cast from `text' to `xml' since there's well-formedness checking done anyway, but in this case the real problem is that JPA doesn't let you specify an explicit JPA type or override how the value is passed to the JDBC driver. Some specific JPA implementations offer extensions for this, though. -- Craig Ringer