Re: Schema version control

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
Cc: Rob Sargent <robjsargent(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Schema version control
Date: 2011-02-11 15:11:29
Message-ID: 20110211101129.91fe45c2.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In response to Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>:

> On 10 Feb 2011, at 23:59, Bill Moran wrote:
>
> > The overview:
> > You store your schema and data as XML (this is easy to migrate to, because
> > it includes a tool that makes the XML from a live database)
> > Keep your XML schema files in some RCS.
>
> That reminds me of something I've been wondering about - How well do modern RCSs deal with structured data formats (like XML)? It would appear that most of them still use diff, which is line-based with limited context tracking, to determine change-sets.
>
> Is that combination guaranteed to result in valid XML if you merge revisions that are far enough apart? Or are there RCSs around that know about XML format (and possibly other structured formats) and handle it differently?
>
> I've heavily used RCSs (mostly Subversion) with, for example HTML, and merge conflicts haven't been unusual. It doesn't help Subversion's diff is a bit simplistic about white-space, I'm sure some of those conflicts were quite unnecessary.

We keep a lot of XML in RCS (Subversion) aside from just our DB schemas,
and our experience has been somewhat similar to your experience with
HTML. Since SVN is a line-based RCS, it can occasionally be painful
to resolve conflicts.

Probably our best defense against the problem is that we have a commit
hook that won't let you commit unless the xml file validates against
the DTD first. This forces developers to make sure they haven't
mangled the xml.

The second best defense (in my opinion) is careful formatting. By keeping
each tag on its own line, and indenting consistently, the number of mangled
xml files was never much worse than the number of mangled source code
files. (even before we had the commit hooks)

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bill Thoen 2011-02-11 19:43:52 Re: plsql question
Previous Message Bill Moran 2011-02-11 14:19:14 Re: Schema version control