NAME
getddl - a ddl to svn script for postgres
SYNOPSIS
A perl script to query a postgres database, write schema to file, and then check in said files.
VERSION
This document refers to version 0.4 of getddl, released May 29, 2008
USAGE
To use getddl, you need to configure several variables inside the script (mostly having to do with different connection options). Once configured, you call gettdll at the command line.
Example 1: grab ddl for both the tables and function and dump it to /db/schema/ridley, check-in any modifications or new objects, and remove any entries that no longer exist in svn.
perl /home/postgres/getddl.pl --host ridley --ddlbase /db/schema/ --getddl --getprocs --svn --svndel >> /home/postgres/logs/getddl.log
Example 2: grab ddl of only database functions and dump it to /db/schema/kraid.
perl /home/postgres/getddl.pl --host kraid --ddlbase /db/schema --getprocs
BUGS AND LIMITATIONS
Overloaded functions will be dumped from the database non-deterministically
Some actions may not work on older versions of Postgres (before 8.1).
Please report any problems to robert@omniti.com.
TODO
- * clean up / optimize iteration for items in svn lists
- * clean-up default hosts directives
- * validate config options vs. command line options
- * drop items into thier own directories (ie. host/tables/tblname.sql and host/functions/funcname.sql)
- * add support for function overloading, preferrably dumping all versions to single file
- * add support for other rcs systems
LICENSE AND COPYRIGHT
Copyright (c) 2008 OmniTI, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
