Re: pg_depend explained - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_depend explained
Date
Msg-id 25830.1294845357@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_depend explained  (Joel Jacobson <joel@gluefinance.com>)
Responses Re: pg_depend explained
List pgsql-hackers
Joel Jacobson <joel@gluefinance.com> writes:
> Also, circular dependencies seems impossible for some object classes,
> such as functions, views, constraints and triggers.

regression=# create table tt(f1 int, f2 int);
CREATE TABLE
regression=# create view v1 as select * from tt;
CREATE VIEW
regression=# create view v2 as select * from v1;
CREATE VIEW
regression=# create or replace view v1 as select * from v2;
CREATE VIEW
regression=# drop view v1;
ERROR:  cannot drop view v1 because other objects depend on it
DETAIL:  view v2 depends on view v1
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
regression=# drop view v2;
ERROR:  cannot drop view v2 because other objects depend on it
DETAIL:  view v1 depends on view v2
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

This isn't particularly *useful*, maybe, but it's hardly "impossible".
And if we analyzed function dependencies in any detail, circular
dependencies among functions would be possible (and useful).
        regards, tom lane


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Allowing multiple concurrent base backups
Next
From: Heikki Linnakangas
Date:
Subject: Re: Allowing multiple concurrent base backups