Recursively trace all Foreign Key "referenced by" tables?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Recursively trace all Foreign Key "referenced by" tables?
Date: 2024-04-14 02:35:05
Message-ID: CANzqJaBULUGh=NhEFmp4csTz3DygSVp4VDraeBx_2srhesgRfQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The attached PG function dba.get_fk_referenced_by() has been tested on PG
9.6 and 14.

A recursive bash function (also attached) calls the PG function, and
displays the whole tree of tables that the table in question depends on.
Output also attached.

Is there a better way to do this? (I'm limited to scripting languages and
what can be installed from RPM files.)

Attachment Content-Type Size
FK tree.txt text/plain 8.3 KB

Browse pgsql-general by date

  From Date Subject
Next Message jack 2024-04-14 14:24:44 constant crashing
Previous Message Adrian Klaver 2024-04-13 16:14:44 Re: Question on trigger