X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 91BDCD1B7C5 for ; Mon, 14 Jun 2004 04:26:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 22253-06 for ; Mon, 14 Jun 2004 07:26:05 +0000 (GMT) Received: from jais.jouy.inra.fr (jais.jouy.inra.fr [138.102.1.17]) by svr1.postgresql.org (Postfix) with ESMTP id A0DD5D1B7C1 for ; Mon, 14 Jun 2004 04:26:02 -0300 (ADT) Received: from diamant.jouy.inra.fr (localhost [127.0.0.1]) by jais.jouy.inra.fr (8.10.1/8.10.1) with ESMTP id i5E7PT720869 for ; Mon, 14 Jun 2004 09:25:30 +0200 (CEST) Received: from pc502jlo (pc502ljo [138.102.3.71]) by diamant.jouy.inra.fr (8.10.1/8.10.1) with SMTP id i5E7PEP21100 for ; Mon, 14 Jun 2004 09:25:14 +0200 (CEST) Message-ID: <003401c451e0$be9e3520$4703668a@pc502jlo> From: "Jouneau Luc" To: References: <40C97EE7.8030901@ceedees.com> Subject: Re: [ADMIN] doubt Date: Mon, 14 Jun 2004 09:25:18 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/48 X-Sequence-Number: 10250 Hi, It seems there's something wrong in the design of your db : Don't you have another table containing name attribute as primary key which you could refer as foreign key in staf_xxxx ? I don't know how to implement what you want to do, except perhaps implementing your own referential control in procedural sql functions fired by triggers. Anyhow, it is better design pattern to use sequential number without any business meaning as primary key. Luc Jouneau ----- Original Message ----- From: "sathish" To: Sent: Friday, June 11, 2004 11:44 AM Subject: [ADMIN] doubt > 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? > your immediate reply will be helpful > yours sincerely > SathishKumar.S > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >