Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eP8po-0008Il-9Q for pgsql-general@arkaria.postgresql.org; Wed, 13 Dec 2017 15:20:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eP8pn-0004jS-S5 for pgsql-general@arkaria.postgresql.org; Wed, 13 Dec 2017 15:20:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eP8pn-0004ft-Gi for pgsql-general@lists.postgresql.org; Wed, 13 Dec 2017 15:20:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eP8pl-0001Wp-2u for pgsql-general@lists.postgresql.org; Wed, 13 Dec 2017 15:20:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vBDFKVac029505; Wed, 13 Dec 2017 10:20:31 -0500 From: Tom Lane To: Jeremy Finzel cc: pgsql-general@lists.postgresql.org Subject: Re: Dependency tree to tie type/function deps to a table In-reply-to: References: Comments: In-reply-to Jeremy Finzel message dated "Wed, 13 Dec 2017 09:07:16 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29503.1513178431.1@sss.pgh.pa.us> Date: Wed, 13 Dec 2017 10:20:31 -0500 Message-ID: <29504.1513178431@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jeremy Finzel writes: > It looks like the very useful dependency tree shown when using DROP CASCADE > is written in C in dependency.c, but there is no way to leverage this > within Postgres to actually query an object's dependencies. Can we get > this somehow as a Postgres client in SQL? Seems like you could build a query for that easily enough using a recursive union over pg_depend plus pg_describe_object() to produce text descriptions of the entries. regards, tom lane