Using duplicate foreign keys

Поиск
Список
Период
Сортировка
От Andrus
Тема Using duplicate foreign keys
Дата
Msg-id enjdia$12tq$1@news.hub.org
обсуждение исходный текст
Ответы Re: Using duplicate foreign keys  (Erik Jones <erik@myemma.com>)
Список pgsql-general
I have multi-company database.
Each company has its own chart of accounts table which are stored in each
company schema.
Some account numbers are used in a common table which is stored in public
schema.

So I need to create duplicate foreign keys like

create temp table company1.chartoffaccounts ( accountnumber int primary
key);
create temp table company2.chartoffaccounts ( accountnumber int primary
key);

create temp table public.commontable ( accountnumber int,
   FOREIGN KEY (accountnumber)   REFERENCES c1hartoffaccounts
(accountnumber)
   FOREIGN KEY (accountnumber)   REFERENCES c2hartoffaccounts
(accountnumber) );


Is it OK to use duplicate foreign keys ? What issues will they cause ?

Andrus.



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

Предыдущее
От: "Romulo Hunter"
Дата:
Сообщение: Update to 8.2 in openSUSE 10.2
Следующее
От: "BigSmoke"
Дата:
Сообщение: Pure PostgreSQL unit tests - test and debug pgsql constraints and procedures/functions