Inheritance of foregn key constraints.

Поиск
Список
Период
Сортировка
От Andrzej Mazurkiewicz
Тема Inheritance of foregn key constraints.
Дата
Msg-id 1523734.6NloWteI3S@tata
обсуждение исходный текст
Ответы Re: Inheritance of foregn key constraints.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
http://wiki.postgresql.org/wiki/Todo

Section "Inheritance"

"Allow inherited tables to inherit indexes, UNIQUE constraints, and 
primary/FOREIGN KEYS"

Good Morning.

I started to program a patch for inheritance of the foreign key constraints. 
I. e. after applying the patch FKs are maintained between foreign table 
inheritance tree (master tree) and a given table inheritance tree (detail 
tree).

My patch need one change that might be of significance.
A type of the depencencies (pg_depend) among the FK constraint (pg_constraint) 
and the corresponding "RI_ConstraintTrigger" triggers has to be changed from 
DEPENDENCY_INTERNAL to DEPENDENCY_AUTO.
If this modification is not applied, the detail child table cannot be dropped 
without prevous dropping the whole FK constraint because the removing 
operation depend on the FK constraint of its parent table.

It also requires an end user to remember about a triggers maintaining 
uniqueness of a parent tree key and about consistent unique indexes/PKs.

Currently the patch works for 9.3 release for ALTER TABLE ... ADD CONSTRAINT 
... FOREIGN KEY ...;
ALTER TABLE ... DROP CONSTRAINT .... or DROP TABLE (master or detail root).
This covers my needs.

As soon as the patch is ready, matching postgres standards and tested I would 
like to add it to the distribution.

I have the following questions.

1. Is the community interested in it? So should I continue my work since it 
matches the postgres standards?

2. If the answer is yes, please comment the above change of the dependency 
type.

Kind regards
Andrzej Mazurkiewicz



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

Предыдущее
От: Rajeev rastogi
Дата:
Сообщение: Re: Standby server won't start
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: Standby server won't start