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

From: Kris Jurka <books(at)ejurka(dot)com>
To: Thomas Hallgren <thomas(at)tada(dot)se>
Cc: "Pgsql-Jdbc(at)Postgresql(dot)Org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [Fwd: Re: [Pljava-dev] char with trailing space,
Date: 2006-06-27 17:17:12
Message-ID: Pine.BSO.4.63.0606271211590.8616@leary2.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Hallgren 2006-06-27 18:06:18 Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject
Previous Message Thomas Hallgren 2006-06-27 16:57:44 [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject & SetString]