Re: Referential integrity using constant in foreign key

Поиск
Список
Период
Сортировка
От Andrus
Тема Re: Referential integrity using constant in foreign key
Дата
Msg-id d2c068$9oc$1@news.hub.org
обсуждение исходный текст
Ответ на Referential integrity using constant in foreign key  ("Andrus Moor" <eetasoft@online.ee>)
Список pgsql-general
Florian,

> Or you create a classifier_1 and a classifier_2 table, each containing
> only the column "code". Then you can drop the "category1" and "category2"
> fields from "info", and just point the foreign keys to the correct table.

Thank you.
I will probably go by this way.

> You can, optionally, create a view "classifer", that combiney both
> classifier_? tables - e.g, do
>
> create view classifier as
> select '1'::char(1) as category, code from classifier_1
> union
> select '2'::char(1) as category, code from classifier_2 ;

I want to insert, update and delete using classifier view for max
compatibility with existing shema from other DBMC which contains real
classifier table.

Which is the best way to make view changeable ?
Is it possible to implement this using rules ?
Is Postgres rule system best and reasonable solution for this?

Andrus.



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

Предыдущее
От: "Elim Qiu"
Дата:
Сообщение: from mysql to pgsql
Следующее
От: Edmund Bacon
Дата:
Сообщение: Re: Debugging deadlocks