From: Markus Schaber <schabios@logi-track.com>
To: Thomas Hallgren <thhal@mailblocks.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Cc: Filip Hrbek <filip.hrbek@plz.comstar.cz>
Subject: Re: PLJava and Database Meta Data
Date: Fri, 11 Feb 2005 14:40:47 +0100
Message-ID: <420CB5DF.5090802@logi-track.com> (raw)
In-Reply-To: <thhal-0aEnoAuFMxic5Cq84dW6PTeXp3iWsbR@mailblocks.com>
References: <420B87A7.6080407@mailblocks.com>
<thhal-0OSDnAts/xicKOdXFhNL1b7jI6Hr/Fb@mailblocks.com>
<420C8477.7060604@logi-track.com>
<420C8647.2010506@mailblocks.com>
<thhal-0yh7oAkFMxiclCh2yth1Ot4ZOLBGAUf@mailblocks.com>
<420C8F16.9040708@logi-track.com>
<420C9333.9040208@mailblocks.com>
<thhal-0tSvoAltMxicJ2/PXRMLL16HFetPb4k@mailblocks.com>
<420C982D.9050401@logi-track.com>
<420CA013.8070009@mailblocks.com>
<thhal-0lzjoAoFMxicX3NiOUR7LneqpK4swBh@mailblocks.com>
<thhal-0lzjoAoNMxiceVLzfQR5Wq+0/NL/omO@mailblocks.com>
<420CAB1A.10908@logi-track.com>
<420CB0E5.3060305@mailblocks.com>
<thhal-0aEnoAuFMxic5Cq84dW6PTeXp3iWsbR@mailblocks.com>
Hi, Thomas,
Thomas Hallgren schrieb:
>> Okay, so this is fine for primitive types. How does SPI deal with
>> complex types?
>>
> A complex type is represented by a C-structure called HeapTuple. A
> HeapTuple is associated with a TupleDesc that acts as its description.
> The HeapTuple is passed by reference (a C-language pointer) and PLJava
> will obtains its individual values as Datums using a function called
> SPI_getbinval. An individual value may of course be a reference to
> another complex type.
>
> Complex types are created using the function heap_form_tuple.
Okay, sounds good. So it seems that PostGIS/PLJava would need some
understanding of PostGIS internal layout in addition to the canonical
representations it uses on the client side.
Two additional features that are needed to parse the PostGIS internal
rep are optional fields (presence is flagged by bits in other fields)
and arrays (both as complex types). And there must be no issues with
strange alignments.
(All of this how I remember the discussions on the PostGIS mailing list,
I did not do any server-side PostGIS coding myself up to now.)
>> Yes, I have. Especially for large geometries. In our database, we have
>> geometry objects up to 20MB per piece. Also, in PostGIS, send/receive
>> binary representation differs slightly from internal representation (and
>> input/output text is even more overhead).
>
> Ok. We are probably talking about different things. I'm referring to the
> internal C-functions that are executed directly in the backend.
I talked about those backend functions that are declared in CREATE TYPE
statement, which create the canonical text or binary representation
which is sent over to clients (or received from them). This also are the
representations which jdbc works on.
For primitive types, the binary rep equals the internal rep (minus
endianness?), and such conversion is cheap. But this is different for
other types, especially those which are huge in size.
BTW, while loading the PLJava sources from CVS into Eclipse, I found a
small problem in Backend.java, line 127 (the non-1.5 version):
if(perm.getActions().contains("write") &&
perm.getName().startsWith("java."))
In Java 1.4 (I tried sun and ibm ones), String has no contains() method.
Markus
--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios@logi-track.com | www.logi-track.com
Attachments:
signature.asc (application/pgp-signature, 255B) download
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: schabios@logi-track.com, thhal@mailblocks.com, filip.hrbek@plz.comstar.cz
Subject: Re: PLJava and Database Meta Data
In-Reply-To: <420CB5DF.5090802@logi-track.com>
References: <420B87A7.6080407@mailblocks.com> <thhal-0OSDnAts/xicKOdXFhNL1b7jI6Hr/Fb@mailblocks.com> <420C8477.7060604@logi-track.com> <420C8647.2010506@mailblocks.com> <thhal-0yh7oAkFMxiclCh2yth1Ot4ZOLBGAUf@mailblocks.com> <420C8F16.9040708@logi-track.com> <420C9333.9040208@mailblocks.com> <thhal-0tSvoAltMxicJ2/PXRMLL16HFetPb4k@mailblocks.com> <420C982D.9050401@logi-track.com> <420CA013.8070009@mailblocks.com> <thhal-0lzjoAoFMxicX3NiOUR7LneqpK4swBh@mailblocks.com> <thhal-0lzjoAoNMxiceVLzfQR5Wq+0/NL/omO@mailblocks.com> <420CAB1A.10908@logi-track.com> <420CB0E5.3060305@mailblocks.com> <thhal-0aEnoAuFMxic5Cq84dW6PTeXp3iWsbR@mailblocks.com> <420CB5DF.5090802@logi-track.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