agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feedSubject: [Pljava-dev] VarLenTuple example code
Date: Thu, 28 Sep 2006 16:25:34 +0200
Message-ID: <451BDB5E.1020107@tada.se> (raw)
In-Reply-To: <451BD650.2080201@logix-tt.com>
References: <451BD0B1.8000408@logix-tt.com>
<451BD2F4.60202@tada.se>
<451BD650.2080201@logix-tt.com>
Markus Schaber wrote:
> Hi, Thomas,
>
> Thomas Hallgren wrote:
>
>> Hmm, perhaps just an oversight, bot you don't have UDT syntax on the
>> send/receive methods, i.e. this line:
>>
>> + AS 'org.postgresql.pljava.example.VarLenTuple.receive'
>>
>> should read
>>
>> + AS 'UDT[org.postgresql.pljava.example.VarLenTuple] receive'
>>
>
> That was intentional, as I wanted the customary written send and receive
> methods to be called (and not those from UDT.c) as I want the
> send/receive binary format [type B)] in a platform independent
> big-endian format, different from the internal one [type C)].
>
> Declaring those methods without UDT[] magic was the way I hoped to
> achieve that, according to how I understood our discussion.
>
>
No, in that case you must have misunderstood. When you do that, you
remove the middleman that sets up the correct SQLData semantics. The
send/receive functions in PostgreSQL maps to the readSQL/writeSQL
methods in SQLData. The readSQL is the method that supposedly populate
your VarLenTuple from the byte buffer native presentation (wrapped in
the SQLInput). The writeSQL creates the native presentation byte buffer
(wrapped in the SQLOutput) from the VarLenTuple. There's absolutely no
need for you to create some other send/receive mechanism in Java.
Regards,
Thomas Hallgren
view thread (18+ messages) latest in thread
Message-ID: <451BDB5E.1020107@tada.se>
Permalink: ../451BDB5E.1020107@tada.se/
Also on: postgresql.org/message-id/451BDB5E.1020107@tada.se
reply
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 using the --to and --cc options:
reply via email
To: pljava-dev@postgresql.org
Subject: Re: [Pljava-dev] VarLenTuple example code
In-Reply-To: <451BDB5E.1020107@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox