<div dir="ltr">Information_schema that shows Foriegn Key constraints should be more or less standard across RDBMS.<div><br></div><div>Something like this might be a start. </div><div><br></div><div><pre class="lang-sql prettyprint prettyprinted" style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span class="kwd" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">select</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
concat</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">table_name</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="str" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'.'</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> column_name</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="kwd" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">as</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="str" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'foreign key'</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
concat</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">referenced_table_name</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="str" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'.'</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> referenced_column_name</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="kwd" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">as</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="str" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'references'</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
</span><span class="kwd" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">from</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
information_schema</span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">key_column_usage
</span><span class="kwd" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">where</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
referenced_table_name </span><span class="kwd" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">is</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="kwd" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">not</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="kwd" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">null</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
</span><span class="kwd" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">and</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> table_schema </span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="str" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'my_database'</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
</span><span class="kwd" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">and</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> table_name </span><span class="pun" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="pln" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="str" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'my_table'</span></code></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 11, 2015 at 5:11 PM, Pat <span dir="ltr"><<a href="mailto:pat@linuxcolumbus.com" target="_blank">pat@linuxcolumbus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Would be easy enough to script via the DB metadata. I use squirrel-sql<br>
for most DB tasks since it supports most databases via jdbc.<br>
<span class="HOEnZb"><font color="#888888"><br>
Pat<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 2015-08-11 12:24, <a href="mailto:jep200404@columbus.rr.com">jep200404@columbus.rr.com</a> wrote:<br>
> What program shows the parent/child relationships for all the<br>
> tables of a database? I am looking for a program that would have<br>
> plain text output, with one table name on each line, and<br>
> indentation indicating the parent/child relationship<br>
> in an outline kind of format.<br>
> I have not found good results searching the web,<br>
> not even of GUI tools.<br>
><br>
> I am using postgresql, but a nice program would work with<br>
> other database software, such as MariaDB, also.<br>
> _______________________________________________<br>
> colug-432 mailing list<br>
> <a href="mailto:colug-432@colug.net">colug-432@colug.net</a><br>
> <a href="http://lists.colug.net/mailman/listinfo/colug-432" rel="noreferrer" target="_blank">http://lists.colug.net/mailman/listinfo/colug-432</a><br>
_______________________________________________<br>
colug-432 mailing list<br>
<a href="mailto:colug-432@colug.net">colug-432@colug.net</a><br>
<a href="http://lists.colug.net/mailman/listinfo/colug-432" rel="noreferrer" target="_blank">http://lists.colug.net/mailman/listinfo/colug-432</a><br>
</div></div></blockquote></div><br></div>