pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jouneau Luc <Luc.Jouneau@diamant.jouy.inra.fr>
To: pgsql-jdbc@postgresql.org
Subject: Re: [ADMIN] doubt
Date: Mon, 14 Jun 2004 09:25:18 +0200
Message-ID: <003401c451e0$be9e3520$4703668a@pc502jlo> (raw)
References: <40C97EE7.8030901@ceedees.com>

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" <sathish@ceedees.com>
To: <pgsql-jdbc@postgresql.org>
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
>




view thread (13+ messages)  latest in thread

Message-ID: <003401c451e0$be9e3520$4703668a@pc502jlo>
Permalink:  ../003401c451e0$be9e3520$4703668a@pc502jlo/
Also on:    postgresql.org/message-id/003401c451e0$be9e3520$4703668a@pc502jlo

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: Luc.Jouneau@diamant.jouy.inra.fr, pgsql-jdbc@postgresql.org
  Subject: Re: [ADMIN] doubt
  In-Reply-To: <003401c451e0$be9e3520$4703668a@pc502jlo>
  References: <40C97EE7.8030901@ceedees.com> <003401c451e0$be9e3520$4703668a@pc502jlo>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox