From: | Bruno Wolff III <bruno(at)wolff(dot)to> |
---|---|
To: | sathish <sathish(at)ceedees(dot)com> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: [ADMIN] doubt |
Date: | 2004-06-14 15:22:02 |
Message-ID: | 20040614152202.GA8883@wolff.to |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin pgsql-jdbc |
On Fri, Jun 11, 2004 at 15:14:07 +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.
No. References need to be to keys (columns with a unique index on just
the columns being referenced).
In this case you almost certainly what to have the name table separate
from the skill table and have both the skill table and the other table
refer to the name table.
> 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?
> your immediate reply will be helpful
> yours sincerely
> SathishKumar.S
From | Date | Subject | |
---|---|---|---|
Next Message | Mathew, Anitha | 2004-06-14 20:46:11 | initdb fails on hpux |
Previous Message | Bjoern Metzdorf | 2004-06-14 13:55:55 | Re: could not open file "/var/lib/pgsql/data/pg_xlog/0000000000000001" |
From | Date | Subject | |
---|---|---|---|
Next Message | Duane Lee - EGOVX | 2004-06-14 16:48:53 | Re: [ADMIN] doubt |
Previous Message | Jouneau Luc | 2004-06-14 07:25:18 | Re: [ADMIN] doubt |