2
<document xmlns:j="jelly:core">
5
<title>Welcome to Another PostgreSQL Diff Tool</title>
6
<author email="miroslav.sulc@startnet.cz">Miroslav Šulc</author>
7
<revision>$Revision: 85 $</revision>
11
<section name="Welcome to Another PostgreSQL Diff Tool">
13
Another PostgreSQL Diff Tool is simple PostgreSQL diff tool that
14
is useful for schema upgrades. The tool compares two schema dump
15
files and creates output file that is (after some hand-made
16
modifications) suitable for upgrade of old schema.
19
I created this tool because I need to perform PostgreSQL
20
database schema upgrades for our application. I didn't found
21
anything suitable so I created this simple tool. I decided to
22
place it here on SourceForge.Net because it might be useful for
23
other developers too. If you find the tool useful too please
24
let me know and I may create a Used By section here at the site.
27
<section name="How the Program Works">
29
apgdiff is a command-line tool. It takes two parameters. One is
30
the original database schema dump file, the other is the new
31
database schema dump file. The command might look like this:
33
<code>java -jar apgdiff.jar original_schema_dump.sql new_schema_dump.sql</code>
35
After you submit the command, you will see list of SQL commands
36
and modification information on the screen. You can also redirect
39
<code>java -jar apgdiff.jar original_schema_dump.sql new_schema_dump.sql > diff.sql</code>
41
For more information run apgdiff without parameters:
43
<code>java -jar apgdiff.jar</code>
45
<section name="List of Features">
48
apgdiff looks for differences in definitions of TABLEs,
49
SEQUENCEs, CONSTRAINTs, INDEXes, VIEWS, FUNCTIONs and TRIGGERs
52
apgdiff creates SQL commands for creations, drops and
53
modifications of database objects
56
CREATE SCHEMA, CREATE TABLE, ALTER TABLE (except ALTER TABLE ... OWNER TO
57
...), CREATE SEQUENCE, CREATE INDEX, CREATE (OR REPLACE )VIEW,
58
CREATE (OR REPLACE )FUNCTION, CREATE TRIGGER and
59
SET search_path commands are supported but some specific
60
features of the commands may not be implemented yet
64
Comments, empty lines, SET (except SET search_path), COMMENT,
65
SELECT, INSERT INTO, REVOKE, GRANT and possibly other
70
Note: apgdiff is no more depending on formatting of SQL commands
71
so it can be used on dumps from different version of PostgreSQL,
72
on SQL commands from pgAdmin, hand-written SQL commands etc.
73
I do the testing on dumps from PostgreSQL 8.1.x. Please note
74
that there are some differences in what parameters are default
75
in what versions of PostgreSQL (for example creation of OIDS)
76
so have this in mind while creating your diffs as apgdiff
77
defaults to the defaults of PostgreSQL 8.x.
80
<section name="Requirements">
82
apgdiff is a Java program so you need Java installed. apgdiff
83
requires at least Java 1.5. I use "Sun JDK 1.6.0".
88
There are two kinds of bugs in apgdiff:
92
bugs for currently supported features (they should be rare
93
because they should be caught by automated tests)
96
bugs caused by not implemented features
100
No matter of what bug you came across, please file it to
101
<a href="http://sourceforge.net/tracker/?group_id=163508&atid=828023">Bugs Tracker</a>.
102
If you have a patch for such a bug then please file it to
103
<a href="http://sourceforge.net/tracker/?group_id=163508&atid=828025">Patches</a>.
106
<section name="Future">
108
As I use this tool quite often I will probably release new
109
versions from time to time. If you are interested in this tool
110
and have a patch for it, put it to
111
<a href="http://sourceforge.net/tracker/?group_id=163508&atid=828025">Patch Tracker</a>
112
and I'll add it to a new release. Also, if you would like to see
113
a new feature in apgdiff then you can submit
114
<a href="http://sourceforge.net/tracker/?group_id=163508&atid=828026">Feature Request</a>.
117
<section name="Contact">
119
You can contact me at <a href="mailto:miroslav.sulc@startnet.cz">miroslav.sulc@startnet.cz</a>.