Skip site navigation (1) Skip section navigation (2)

Re: pg_depend explained

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joel Jacobson <joel(at)gluefinance(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Florian Pflug <fgp(at)phlo(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_depend explained
Date: 2011-01-12 15:15:57
Message-ID: 25830.1294845357@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Joel Jacobson <joel(at)gluefinance(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2011-01-12 15:17:38
Subject: Re: Allowing multiple concurrent base backups
Previous:From: David FetterDate: 2011-01-12 15:15:24
Subject: Re: Allowing multiple concurrent base backups

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group