Re: Finding recursive dependencies - Mailing list pgsql-general

From Tom Lane
Subject Re: Finding recursive dependencies
Date
Msg-id 19598.1294069066@sss.pgh.pa.us
Whole thread Raw
In response to Re: Finding recursive dependencies  (Joel Jacobson <joel@gluefinance.com>)
Responses Re: Finding recursive dependencies
List pgsql-general
Joel Jacobson <joel@gluefinance.com> writes:
> 2011/1/2 Tom Lane <tgl@sss.pgh.pa.us>
>> The thing you're missing is that implicit dependencies are really
>> bidirectional:

> So, basically it's not possible to define a recursive query only making use
> of pg_depend to build an entire dependency tree of all oids?
> It appears to me it's necessary to join the object type specific tables,
> such as pg_rewrite, to build a complete tree?

No, that's nonsense.  The information is in pg_depend; it's just not
expressed in a way that makes it easy to scan it in a single recursive
query.  If you could do something like

    select base-case
    union all
    select objid ... where refobjid matches
    union all
    select refobjid ... where objid matches and deptype = 'i'

then it'd be easy, but you only get one UNION ALL per recursive query.

            regards, tom lane

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pgloader an Indexes / was: Re: CSV-bulk import and defaults
Next
From: Adrian Klaver
Date:
Subject: Re: problem updating from form