Re: Foreign key question

Поиск
Список
Период
Сортировка
От James M Moe
Тема Re: Foreign key question
Дата
Msg-id 4007057C.9040909@sohnen-moe.com
обсуждение исходный текст
Ответ на Re: Foreign key question  (Martin Marques <martin@bugs.unl.edu.ar>)
Список pgsql-general
Victor Spång Arthursson wrote:
 >
 > The first is, i have a language table with a primary key on the
fields lang and relid:
 >
 > relid | lang |    text
 > -------+------+-------------
 >  11111 | uk   | hello
 >  11111 | dk   | hej
 >  11111 | de   | guten tag
 >  11112 | uk   | world
 >  11112 | dk   | værld
 >
 > In another table, texts, I have the following:
 >
 > id | text
 > -------+------+
 >  4 | 11112   |
 >
   Given what you have shown, there is no way foreign keys can work here.
   Foreign keys are links between the key values of two tables in a sort
of master/slave relationship.

 > What I want to do is to create a foreign key between the two tables.

   What problem does the concept of a foreign key solve for you?


--
jimoe at sohnen-moe dot com

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: serverless postgresql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bytea/Large Objects/external files best practices