Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group