Search Postgresql Archives

Re: Schema version control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In response to Alban Hertroys <dalroi@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:

> 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/

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux