Re: Array passing

From: John Lister <john(dot)lister-ps(at)kickstone(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Array passing
Date: 2009-04-08 07:33:44
Message-ID: 49DC5358.3090700@kickstone.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Cheers for the pointer to the patches, i'll have a look.... I may be
over simplifying things (and i haven't looked at probably nearly enough
of the jdbc code) but surely the driver knows from the server what types
it is returning and can thus convert to whatever the user wants in the
same way it converts from string.

Kris Jurka wrote:
>
>
> On Tue, 7 Apr 2009, John Lister wrote:
>
>> Looking at the spec/docs although you can specify the return type in
>> the protocol there is no way to do it.. The only way i can see is to
>> use a stored procedure and specifying the return type there using
>> registerOutParameter(). However looking in the code
>> (SimpleParameterList) although the parameter is set to OUT, the
>> return type is ignored...
>>
>
> A parameter being in-vs-out is only relevent to function arguments
> being in or out, they have nothing to do with the format (text/binary)
> of the data, or even the direction data is traveling (from
> server/client).
>
>> Would setting the return type like this cause any problems?
>>
>
> If you could rig this up to set a flag indicating it should be binary,
> that wouldn't magically make everyone else respect it and do all the
> necessary conversions. You'd end up sending or receiving garbage data.
>
> The place to start is really with the existing binary transfer patches:
>
> http://archives.postgresql.org/pgsql-jdbc/2008-11/msg00000.php
>
> I've only looked at the patches to receive data in binary form, but
> there are also patches to send data in binary as well. Perhaps you
> can just apply them and all will be well, if not they're a good
> starting point and should at least demonstrate the scope of the
> problem (it's not just setting a flag).
>
> Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2009-04-08 10:31:28 Re: Array passing
Previous Message Thomas Kellerer 2009-04-08 06:38:46 Re: BLOB help - yes I've read around!