X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0B7358BA1AF for ; Fri, 11 Feb 2005 13:41:11 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92680-10 for ; Fri, 11 Feb 2005 13:40:56 +0000 (GMT) Received: from mail.logi-track.com (www.logi-track.com [213.239.193.212]) by svr1.postgresql.org (Postfix) with ESMTP id 76CFD8BA0FF for ; Fri, 11 Feb 2005 13:40:56 +0000 (GMT) Received: from kingfisher.intern.logi-track.com (J3b73.j.pppool.de [85.74.59.115]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logi-track.com (Postfix) with ESMTP id 6CBD3308C9; Fri, 11 Feb 2005 14:40:59 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with ESMTP id CA8E5165E64; Fri, 11 Feb 2005 14:40:53 +0100 (CET) Message-ID: <420CB5DF.5090802@logi-track.com> Date: Fri, 11 Feb 2005 14:40:47 +0100 From: Markus Schaber User-Agent: Mozilla Thunderbird 1.0 (X11/20050116) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: Thomas Hallgren Cc: "pgsql-jdbc@postgresql.org" , Filip Hrbek Subject: Re: PLJava and Database Meta Data References: <420B87A7.6080407@mailblocks.com> <420C8477.7060604@logi-track.com> <420C8647.2010506@mailblocks.com> <420C8F16.9040708@logi-track.com> <420C9333.9040208@mailblocks.com> <420C982D.9050401@logi-track.com> <420CA013.8070009@mailblocks.com> <420CAB1A.10908@logi-track.com> <420CB0E5.3060305@mailblocks.com> In-Reply-To: X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigE6CDF79B2307AD3D02F9F740" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/92 X-Sequence-Number: 12272 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE6CDF79B2307AD3D02F9F740 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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 --------------enigE6CDF79B2307AD3D02F9F740 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCDLXlOVWsnapT9i0RAnHPAJ94pFRujg0Cy/nSLRbu2MKfdqF9QQCg5etT VcpIO2eHn8vOwwTXZAXOUZ4= =ebVG -----END PGP SIGNATURE----- --------------enigE6CDF79B2307AD3D02F9F740--