From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bernard <bht237@gmail.com>
Cc: PG-JDBC Mailing List <pgsql-jdbc@postgresql.org>
Cc: Maciek Sakrejda <msakrejda@truviso.com>
Subject: Re: Fwd: Cannot pass null in Parameter in Query for ISNULL
Date: Sat, 12 May 2012 11:06:21 -0400
Message-ID: <6364.1336835181@sss.pgh.pa.us> (raw)
In-Reply-To: <n16sq71vo0s10l8dpf4k11snepoh8oqdcq@4ax.com>
References: <uik6p75m4v8jfo332vhb2c306u99ojbfu8@4ax.com>
<CADK3HHJqziu=Pks3VBkd+sz54crz=0XwY3UQW-+cFozSMmvk2A@mail.gmail.com>
<CAH_hXRYXhRYWq8bA59pcB0wa_2BiLNFj3DG_2ijQfx1sf3ghGA@mail.gmail.com>
<r7u9p79vb3u6vakooc1mvts017h29k1qkh@4ax.com>
<CAH_hXRZc3LUO1J6=r5x3apx9EvqbtxqA9YyNPj9JdLtqfN-FSw@mail.gmail.com>
<n16sq71vo0s10l8dpf4k11snepoh8oqdcq@4ax.com>
Bernard <bht237@gmail.com> writes:
> May I ask for suggestions for a way forward towards a solution?
The long and the short of this is that your application, which
presumably knows what it might pass for this parameter, has to provide
that type information (by means of using the appropriate setXXX call).
If the server's parser tries to guess a type, that will simply move the
pain from this case to other cases, namely those where the choice really
matters and it guesses wrong. Similarly, the JDBC driver doesn't have
enough information to make a correct guess.
Having said that, it's interesting to wonder how much would break if
setObject were to arbitrarily assume the data type is TEXT. The
response to anybody complaining would be more or less what I'm saying
to you, which is "don't use setObject if you don't like the results".
Again, this would only be shifting the pain from some cases to others,
but I wonder whether there would be more or fewer pain cases.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: tgl@sss.pgh.pa.us, bht237@gmail.com, msakrejda@truviso.com
Subject: Re: Fwd: Cannot pass null in Parameter in Query for ISNULL
In-Reply-To: <6364.1336835181@sss.pgh.pa.us>
References: <uik6p75m4v8jfo332vhb2c306u99ojbfu8@4ax.com> <CADK3HHJqziu=Pks3VBkd+sz54crz=0XwY3UQW-+cFozSMmvk2A@mail.gmail.com> <CAH_hXRYXhRYWq8bA59pcB0wa_2BiLNFj3DG_2ijQfx1sf3ghGA@mail.gmail.com> <r7u9p79vb3u6vakooc1mvts017h29k1qkh@4ax.com> <CAH_hXRZc3LUO1J6=r5x3apx9EvqbtxqA9YyNPj9JdLtqfN-FSw@mail.gmail.com> <n16sq71vo0s10l8dpf4k11snepoh8oqdcq@4ax.com> <6364.1336835181@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox