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