[Pljava-dev] VarLenTuple example code

From: thomas at tada(dot)se (Thomas Hallgren)
To:
Subject: [Pljava-dev] VarLenTuple example code
Date: 2006-09-28 14:25:34
Message-ID: 451BDB5E.1020107@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

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

In response to

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Markus Schaber 2006-09-28 14:50:19 [Pljava-dev] VarLenTuple example code
Previous Message Markus Schaber 2006-09-28 14:04:00 [Pljava-dev] VarLenTuple example code