From: | Bruno Wolff III <bruno(at)wolff(dot)to> |
---|---|
To: | sathish <sathish(at)ceedees(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: doubt |
Date: | 2004-06-14 17:54:53 |
Message-ID: | 20040614175453.GA12185@wolff.to |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, Jun 11, 2004 at 15:12:36 +0530,
sathish <sathish(at)ceedees(dot)com> wrote:
> dear groups,
> i have a doubt in sql,
> i have a table staff_skills in which i have set a table level
> constraint to create a primary key of two fields .
> so 'name' and 'skill' combinedly forms a primary key.
> now the issue is in another table i have only 'name' field and i
> want to create a foreign key constraint which refers the staff_skills
> table's 'name' field only.
> staff_skills (table) - name,skill,ability (columns) --- primary
> key(name,skill)
> staff_xxxx (table) - name,x,y,z (columns) --- foreign
> key(name) references staff_skills(name).
> how to do the above?
This reference is the wrong way. The staff_skills table's name column
should reference name in the staff_xxxx table.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2004-06-14 18:58:39 | Re: Different runtime on the same query |
Previous Message | Duane Lee - EGOVX | 2004-06-14 17:51:58 | Re: Keep history of modifications |