From: Thomas Hallgren <thomas@tada.se>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kris Jurka <books@ejurka.com>
Cc: Pgsql-Jdbc@Postgresql.Org <pgsql-jdbc@postgresql.org>
Subject: Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject
Date: Wed, 28 Jun 2006 00:49:52 +0200
Message-ID: <44A1B610.3020801@tada.se> (raw)
In-Reply-To: <8536.1151447483@sss.pgh.pa.us>
References: <44A16388.3060108@tada.se>
<Pine.BSO.4.63.0606271211590.8616@leary2.csoft.net>
<44A1739A.2080102@tada.se>
<26695.1151435851@sss.pgh.pa.us>
<44A18A53.5000107@tada.se>
<7957.1151442476@sss.pgh.pa.us>
<44A1A285.6000900@tada.se>
<8536.1151447483@sss.pgh.pa.us>
Tom Lane wrote:
> 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.
>
>
My mistake. I thought that given a statement like:
SELECT p.name FROM people p WHERE p.zipcode = ?
the actual type returned by SPI_getargtype would be inferred by the
expression 'p.zipcode'. I guess that's not the case. Instead I need to
provide the information earlier, like:
SELECT p.name FROM people p WHERE p.zipcode = ?::varchar
is that correct? If so, is there any way that I can automatically infer
the best type?
Regards,
Thomas Hallgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: thomas@tada.se, tgl@sss.pgh.pa.us, books@ejurka.com
Subject: Re: [Fwd: Re: [Pljava-dev] char with trailing space, PreparedStatement.setObject
In-Reply-To: <44A1B610.3020801@tada.se>
References: <44A16388.3060108@tada.se> <Pine.BSO.4.63.0606271211590.8616@leary2.csoft.net> <44A1739A.2080102@tada.se> <26695.1151435851@sss.pgh.pa.us> <44A18A53.5000107@tada.se> <7957.1151442476@sss.pgh.pa.us> <44A1A285.6000900@tada.se> <8536.1151447483@sss.pgh.pa.us> <44A1B610.3020801@tada.se>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox