Search Postgresql Archives

Using duplicate foreign keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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. 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux