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