Re: Foreign key to 2 tables problem
От | Neil Saunders |
---|---|
Тема | Re: Foreign key to 2 tables problem |
Дата | |
Msg-id | ddcd549e0511220731p11b4fd86v6d9b56e4d0144262@mail.gmail.com обсуждение исходный текст |
Ответ на | Foreign key to 2 tables problem (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>) |
Список | pgsql-sql |
As far as I'm aware, not without using an intermediatary table (id, cust_id, supplier_id) . Otherwise, how would you know which table the foreign key was referencing? That said, an intermediatary table isn't a very clean solution; What problem are you trying to solve, exactly? Kind Regards, Neil. On 11/22/05, Joost Kraaijeveld <J.Kraaijeveld@askesis.nl> wrote: > Hi, > > Is there a way to create a foreign key to 2 tables: e.g. a bankaccount > table that has a column "owner", that must point to a record in either > the customer or the supplier table? > > > TIA > > -- > Groeten, > > Joost Kraaijeveld > Askesis B.V. > Molukkenstraat 14 > 6524NB Nijmegen > tel: 024-3888063 / 06-51855277 > fax: 024-3608416 > e-mail: J.Kraaijeveld@Askesis.nl > web: www.askesis.nl > > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq >
В списке pgsql-sql по дате отправления: