Dependencies of Matviews?

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Dependencies of Matviews?
Date: 2020-06-23 16:39:37
Message-ID: 800f556a-29cf-3528-d720-84e7eae8ad45@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I would like to extract the dependency between materialized views.

e.g. in the following situation:

create materialized view mv1 as select ....;
create materialized view mv2 as select ... from mv1, ...;

I would like to know that mv2 depends on mv1.

I assumed this could be done through pg_depend, but the only dependency I see there for the matviews is the one for the namespace.

Clearly this information is stored somehow, as a DROP MATERIALIZED VIEW complains about being referenced by other matviews.

Am I missing something in pg_depend or do I need to look in a different system table?

Regards
Thomas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Edu Gargiulo 2020-06-23 16:44:31 Re: pg_dump empty tables
Previous Message Tom Lane 2020-06-23 16:28:30 Re: getting daily stats for event counts