Skip site navigation (1) Skip section navigation (2)

Re: [ADMIN] doubt

From: "Jouneau Luc" <Luc(dot)Jouneau(at)diamant(dot)jouy(dot)inra(dot)fr>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [ADMIN] doubt
Date: 2004-06-14 07:25:18
Message-ID: 003401c451e0$be9e3520$4703668a@pc502jlo (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-jdbc
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(at)ceedees(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)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
>


In response to

  • doubt at 2004-06-11 09:44:07 from sathish

pgsql-admin by date

Next:From: Andreas SchmitzDate: 2004-06-14 08:10:13
Subject: Re: pg_clog after crash
Previous:From: Reko TurjaDate: 2004-06-13 22:51:42
Subject: Re: FreeBSD SHMMAX

pgsql-jdbc by date

Next:From: Bruno Wolff IIIDate: 2004-06-14 15:22:02
Subject: Re: [ADMIN] doubt
Previous:From: Nick FankhauserDate: 2004-06-12 22:56:25
Subject: Re: Simon Moses Qs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group