Re: Thoughs after discussions at OSCON - Mailing list pgsql-advocacy

From Jim C. Nasby
Subject Re: Thoughs after discussions at OSCON
Date
Msg-id 20050816215901.GM5928@pervasive.com
Whole thread Raw
In response to Re: Thoughs after discussions at OSCON  (Rick Morris <rick@brainscraps.com>)
List pgsql-advocacy
On Tue, Aug 16, 2005 at 11:22:05AM -0400, Rick Morris wrote:
> Still, the hard work is in parsing constraint definitions. The
> information_schema tables/views make this information more accessible,
> but still, there is a certain amount of crazy reverse-engineering one
> needs to do. It would be nice eventually for the pgsql modules of any
> language to be able to derive this information, for example, starting
> with the pg_meta_data() function in PHP (http://php.net/pg_meta_data).

http://pgfoundry.org/projects/newsysviews/ might make that task a bit
easier.

> >So far, the best solution I've seen is the XML-based 'datadef' that a
> >friend of mine created at a former job. It was database-centric enough
> >so that it could drive the entire database creation process (including
> >triggers, stored procs, etc) and do it well, while also creating
> >application code (C/C++ in this case). Since it was XML/XSLT based it
> >was pretty easy to add new features, and more importantly, it could
> >support any programming language out there. Everything else I've seen is
> >tied to a specific language, which is a big downside. Unfortunately, he
> >never wanted to release it to the community because he felt the
> >implementation was ugly.
>
> I know the feeling ;).
>
> That approach has merit, but one possible drawback: the developers/DBAs
> might circumvent the datadef and make database design changes directly
> on the DB. Then your application is hosed. I much prefer to develop
> something that allows the application layer to react automatically to
> changes in the database design. (I know that is never *completely*
> possible, but at least in the area of basic constraints and datatypes it
> would be nice)

Very true. Fortunately I've been able to keep that kind of tweaking on
production systems to an absolute minimum everywhere I've worked; the
XML datadef file was the defacto standard for what was in the database.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software        http://pervasive.com        512-569-9461

pgsql-advocacy by date:

Previous
From: Robert Treat
Date:
Subject: Re: Publishing and PostgreSQL
Next
From: Josh Berkus
Date:
Subject: Compliment from the Database Hacker's Handbook