Re: Avoiding explicit addDataType calls for PostGIS

From: Markus Schaber <schabios(at)logi-track(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org, Kris Jurka <books(at)ejurka(dot)com>
Subject: Re: Avoiding explicit addDataType calls for PostGIS
Date: 2004-11-03 11:28:16
Message-ID: 20041103122816.1c6ab2de@kingfisher.intern.logi-track.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

Hi, Oliver,

On Wed, 20 Oct 2004 10:36:39 +1300
Oliver Jowett <oliver(at)opencloud(dot)com> wrote:

> > 1) Is the name postgresql.properties with no package name a good idea? It
> > doesn't seem ideal for an application to have to create an org/postgresql
> > directory just to hold a properties file,
>
> Yes, that's what I was trying to avoid.

But, usually, it will be extension and library writers and not the
application writers that provide the postgresql.properties file.

I think most applications will use URL or Properties to express their
specific wishes.

So I'd prefer to put it into org/postgresql.

> For the datatype.* properties, how do we map them to datasource
> accessors? Having many separate properties is nice from the point of
> view of being able to incrementally add to the property via different
> defaults files, but it's nasty to map to a JavaBean-like accessors (and
> also makes Driver.getPropertyInfo() impossible to completely implement).

Well, we could get nearer to a perfect getPropertyInfo() when we take
all the datatype.* declarations we read from the properties files. This
way, any extension completes the list with its own datatypes, and a
developer / admin can add further ones if needed. (Maybe we should allow
empty datatypes.type declarations for this case).

> Perhaps an array-based accessor, one element per datatype?

Or a Map, so we can index via name.

> Alternatively, collapse all the datatype stuff down to a single property
> and teach the property-munging code how to merge (rather than replace)
> multiple settings of that property together. (this second option is more
> like what JNDI property files do)

This sounds cleaner, IMHO. This would produce (and allow) to specify
something like datatypes=geom:org.postgis.PGgeometry,blubb=com.foo.bar

Should I try to change the patch this way?

Thanks,
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(at)logi-track(dot)com | www.logi-track.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Ojea Castro 2004-11-03 11:56:15 Re: : Unable to load libsqlpg.so
Previous Message Keow Yeong Huat Joseph 2004-11-03 03:04:48 unsubscribe

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2004-11-03 12:38:29 Re: stable release
Previous Message Alan Stange 2004-11-02 21:22:25 Re: executeBatch() issue with new driver?