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 83C303A2019 for ; Sun, 31 Oct 2004 02:16:00 +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 44195-05 for ; Sun, 31 Oct 2004 02:15:47 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 433E23A3FFC for ; Sun, 31 Oct 2004 02:15:49 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CO5Fy-0008Fj-00; Sun, 31 Oct 2004 15:15:46 +1300 Message-ID: <41844B1E.1090204@opencloud.com> Date: Sun, 31 Oct 2004 15:17:02 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.8 (X11/20041021) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: "pgsql-jdbc@postgresql.org" Subject: Re: PGobject overhaul (was Re: tightening up on use of oid References: <41660A56.5000107@opencloud.com> <4167BC1A.4070809@opencloud.com> <416E5B40.1060901@opencloud.com> <418056E5.9060601@opencloud.com> In-Reply-To: X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/314 X-Sequence-Number: 11419 Kris Jurka wrote: > > On Thu, 28 Oct 2004, Oliver Jowett wrote: > > >>For PGobject it turned into a bit of a general overhaul. Currently I have: > > > These changes are way too drastic for something as minor as preventing a > user from accidentally mutating a NULL PGobject. That wasn't really my motivation. It was a general cleanup of PGobject and subclasses. The current implementations leave something to be desired. > These API changes suck > for both developers and users. There's no way to make a PGobject > implementation compile against both 7.4 and 8.0 drivers. Altering the > PGline API means user code can't compile against both 7.4 and 8.0 drivers. The feedback I got earlier was that changing the PGobject API wasn't a big deal and that external users of the API (which seems to boil down to PostGIS & co only) would just track the changes. Is this not true? > If we were providing exciting new features, then maybe, but for now we've > got to find a way to make this work without huge API changes or we should > abandon the whole idea and go back to your original patch. What > immediately comes to mind is making the PGobject interface an abstract > class with all abstract methods so that a developer can implement a type > that can work with both driver versions. That's possible. I'd almost prefer doing a new interface and having PGobject be a completely-abstract implementation of it. Having the driver-required bit as an interface makes it much easier to integrate into whatever representation of the data is convenient to the application. This might be moot if we look at a mapping mechanism that is external to the data objects themselves, as suggested by Markus. Either way, I can't really justify spending much more time on this: we don't use extension types in our code at all, and there is still an (admittedly ugly) way to set NULL values for extension types in the existing driver. -O