Re: pg_depend

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alex Pilosov <alex(at)pilosoft(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_depend
Date: 2001-07-17 16:44:25
Message-ID: Pine.LNX.4.30.0107171831430.678-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian writes:

> Is it? Are we going to record dependency both ways, e.g primary table
> -> foreign table and foreign table -> primary table, or just one of
> them. And when we see we depend on something, do we know always what it
> could be. If I drop a table and I depend on oid XXX, do I know if that
> is a type, function, or serial sequence?

When you drop a table, there are only so many things that could depend on
it:

* rules/views
* triggers
* check constraints
* foreign key constraints
* primary key constraints
* unique constraints
* subtables

including their dependencies. There might be others I forgot but a
finite list can be defined.

When a table is dropped, you scan all of these objects (their system
catalogs) for matches against the table and either do a cascade or
restrict. This is not new, we already do this for indexes and
descriptions, for instance.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-07-17 16:46:35 Re: pg_depend
Previous Message will trillich 2001-07-17 16:11:56 psql -l