Re: Fwd: Cannot pass null in Parameter in Query for ISNULL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fwd: Cannot pass null in Parameter in Query for ISNULL
Дата
Msg-id 6364.1336835181@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Fwd: Cannot pass null in Parameter in Query for ISNULL  (Bernard <bht237@gmail.com>)
Ответы Re: Fwd: Cannot pass null in Parameter in Query for ISNULL  (Bernard <bht237@gmail.com>)
Re: Fwd: Cannot pass null in Parameter in Query for ISNULL  (Bernard <bht237@gmail.com>)
Re: Fwd: Cannot pass null in Parameter in Query for ISNULL  ("Maciek Sakrejda (msakrejd)" <msakrejd@cisco.com>)
Список pgsql-jdbc
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

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Bernard
Дата:
Сообщение: Re: Fwd: Cannot pass null in Parameter in Query for ISNULL
Следующее
От: Bernard
Дата:
Сообщение: Re: Fwd: Cannot pass null in Parameter in Query for ISNULL