From: Oliver Jowett <oliver@opencloud.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kris Jurka <books@ejurka.com>
Cc: Dave Smith <dave.smith@candata.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Problem with fixed length fields.
Date: Sun, 24 Oct 2004 09:44:50 +1300
Message-ID: <417AC2C2.40605@opencloud.com> (raw)
In-Reply-To: <26657.1098556819@sss.pgh.pa.us>
References: <1098532450.2684.3.camel@davehome>
<Pine.BSO.4.56.0410231239390.19312@leary.csoft.net>
<26657.1098556819@sss.pgh.pa.us>
Tom Lane wrote:
> Kris Jurka <books@ejurka.com> writes:
>
>>This is a problem with the driver because it is typing the ' ' values as
>>text, not char, so the comparison doesn't work right because these two
>>types handle trailing spaces differently.
>
>
> Can you refrain from assigning a type at all? People writing the
> equivalent SQL directly would almost always write 'foo', not
> 'foo'::text or 'foo'::char. The parser's behavior has been tuned
> so that that usually works nicely.
We've been trying to avoid that as there is currently no statement
Describe issued by the driver, so we'd run the risk that the parser
would infer something completely unexpected from the driver's point of
view. Also, we'd need the Describe to get useful information on when a
named statement can be safely reused (the driver currently gets this
wrong anyway, but it's fixable without needing a Describe as it stands).
Adding the Describe would add a round-trip to every query that involved
an unknown type.
Pushing on blindly with a Bind without knowing the actual type of the
parameters you're sending seems possible but dangerous. It'd preclude
using binary-format parameters for unknown types, at a minimum.
-O
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: oliver@opencloud.com, tgl@sss.pgh.pa.us, books@ejurka.com, dave.smith@candata.com
Subject: Re: Problem with fixed length fields.
In-Reply-To: <417AC2C2.40605@opencloud.com>
References: <1098532450.2684.3.camel@davehome> <Pine.BSO.4.56.0410231239390.19312@leary.csoft.net> <26657.1098556819@sss.pgh.pa.us> <417AC2C2.40605@opencloud.com>
* 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