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

From Tom Lane
Subject Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject
Date
Msg-id 8536.1151447483@sss.pgh.pa.us
Whole thread Raw
In response to Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject  (Thomas Hallgren <thomas@tada.se>)
Responses Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject  (Thomas Hallgren <thomas@tada.se>)
List pgsql-jdbc
Thomas Hallgren <thomas@tada.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

pgsql-jdbc by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject
Next
From: Thomas Hallgren
Date:
Subject: Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject