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