From: | James M Moe <jimoe(at)sohnen-moe(dot)com> |
---|---|
To: | Postgresql General Mail List <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Foreign key question |
Date: | 2004-01-15 21:26:20 |
Message-ID: | 4007057C.9040909@sohnen-moe.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2004-01-15 21:32:12 | Re: Bytea/Large Objects/external files best practices |
Previous Message | Tom Lane | 2004-01-15 21:21:19 | Re: serverless postgresql |