Re: Schema version control - Mailing list pgsql-general

From Bill Moran
Subject Re: Schema version control
Date
Msg-id 20110211101129.91fe45c2.wmoran@potentialtech.com
Whole thread Raw
In response to Re: Schema version control  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List pgsql-general
In response to Alban Hertroys <dalroi@solfertje.student.utwente.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
(likeXML)? It would appear that most of them still use diff, which is line-based with limited context tracking, to
determinechange-sets. 
>
> Is that combination guaranteed to result in valid XML if you merge revisions that are far enough apart? Or are there
RCSsaround 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'thelp 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/

pgsql-general by date:

Previous
From: Daniel Popowich
Date:
Subject: Re: Schema version control
Next
From: Bill Thoen
Date:
Subject: Re: plsql question