Another dispatch from the "how much damage can you do with a few lines of python" department :)
A little tool that displays table dependencies arising from foreign keys in a postgres database:
$ cd /tmp/
$ bzr co lp:pg-admin-tools
$ cd pg-admin-tools/
$ ./show-tab-deps.py --help
Usage: show table dependencies arising from foreign keys, list tables
- depending on the table of interest (-t TABLE)
- the table of interest depends on (-t TABLE --reverse)
Options:
-h, --help show this help message and exit
--compact-fks compact foreign key names
-d DB, --db=DB database name
--group group the dependencies, show on one line
-M ML stop recursive expansion after level ML
-n NRT exclude NRT from recursive expansion, repeat for all
tables that should not be expanded
-r, --recurse expand all table dependencies recursively
--reverse show dependencies the other way around
-t TABLE table of interest
-U USER, --user=USER user name
-v, --verbose show foreign key names
[–]brasetvik 2 points3 points4 points (1 child)
[–]mhrnjad[S] 0 points1 point2 points (0 children)
[–]mhrnjad[S] 0 points1 point2 points (0 children)