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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Hallgren <thomas(at)tada(dot)se>
Cc: Kris Jurka <books(at)ejurka(dot)com>, "Pgsql-Jdbc(at)Postgresql(dot)Org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject
Date: 2006-06-27 22:31:23
Message-ID: 8536.1151447483@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Thomas Hallgren <thomas(at)tada(dot)se> writes:
> My problem is simple. When I pass a parameter with a trailing space,
> that space is considered significant. When the same thing is done using
> the client jdbc driver, the trailing space is insignificant.

Your problem is not simple, and that's not an adequate description of
it, because you are omitting the influence of context on what the
parameter gets typed as.

The real point here is that the JDBC driver is doing something to prompt
the parser to resolve the types of parameter symbols in particular ways,
and (I gather) you're doing something different. If you want to match
the results they get, then you need to supply the same type information
for parameter symbols to SPI_prepare as they put into Parse messages.

regards, tom lane

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Hallgren 2006-06-27 22:49:52 Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject
Previous Message Thomas Hallgren 2006-06-27 21:26:29 Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject