NAME

Top

getddl - a ddl to svn script for postgres

SYNOPSIS

Top

A perl script to query a postgres database, write schema to file, and then check in said files.

VERSION

Top

This document refers to version 0.4 of getddl, released May 29, 2008

USAGE

Top

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

Top

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

Top

* 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

Top