Re: pg_depend

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: pg_depend
Дата
Msg-id Pine.LNX.4.30.0107171831430.678-100000@peter.localdomain
обсуждение исходный текст
Ответ на Re: pg_depend  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: pg_depend  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список 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@gmx.net   http://funkturm.homeip.net/~peter



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SIGCHLD handler in Postgres C function.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_depend