Re: [Fwd: Re: [Pljava-dev] char with trailing space,

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: [Fwd: Re: [Pljava-dev] char with trailing space,
Дата
Msg-id Pine.BSO.4.63.0606271211590.8616@leary2.csoft.net
обсуждение исходный текст
Ответ на [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject & SetString]  (Thomas Hallgren <thomas@tada.se>)
Ответы Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject
Список pgsql-jdbc

On Tue, 27 Jun 2006, Thomas Hallgren wrote:

> There's an inconsistency between the handling of trailing whitespace in
> query parameters in the client jdbc driver compared to the PL/Java SPI
> based driver. According to Jean-Pierre, the former apparently trims the
> trailing spaces before passing the query (see below). What is the
> correct behavior?

The JDBC driver does not trim spaces.  What it does is pass setString()
values with a type of varchar, perhaps pljava is using text and exposing
this subtle difference:

# select 'a '::char(2) = 'a '::text;
  ?column?
----------
  f
(1 row)
# select 'a '::char(2) = 'a '::varchar;
  ?column?
----------
  t
(1 row)

The original archive discussion here:
http://archives.postgresql.org/pgsql-jdbc/2004-10/msg00241.php

Kris Jurka

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

Предыдущее
От: Thomas Hallgren
Дата:
Сообщение: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject & SetString]
Следующее
От: Thomas Hallgren
Дата:
Сообщение: Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject