pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPK and FK relation ship
2+ messages / 2 participants
[nested] [flat]
* PK and FK relation ship
@ 2003-09-11 06:45 shyamperi@davlin.co.in
2003-09-11 07:26 ` Re: PK and FK relation ship Peter Childs <blue.dragon@blueyonder.co.uk>
0 siblings, 1 reply; 2+ messages in thread
From: shyamperi@davlin.co.in @ 2003-09-11 06:45 UTC (permalink / raw)
To: pgsql-admin
Can any one tell me when would a primary key be refered to as foreign key in
its own table.
-----
Warm Regards
Shÿam Peri
II Floor, Punja Building,
M.G.Road,
Ballalbagh,
Mangalore-575003
Ph : 91-824-2451001/5
Fax : 91-824-2451050
DISCLAIMER: This message contains privileged and confidential information and is
intended only for the individual named.If you are not the intended
recipient you should not disseminate,distribute,store,print, copy or
deliver this message.Please notify the sender immediately by e-mail if
you have received this e-mail by mistake and delete this e-mail from
your system.
Attachments:
Untitled1 (text/html, 751B) download
<head></head><body marginwidth=4 marginheight=4 topmargin=4 leftmargin=4><FONT face=verdana size=2>Can any one tell me when would a primary key be refered to as foreign key in<BR>its own table.</FONT><BR><PRE>-----
Warm Regards
Shÿam Peri
II Floor, Punja Building,
M.G.Road,
Ballalbagh,
Mangalore-575003
Ph : 91-824-2451001/5
Fax : 91-824-2451050
</PRE></body><br><br><b>
DISCLAIMER: This message contains privileged and confidential information and is
intended only for the individual named.If you are not the intended
recipient you should not disseminate,distribute,store,print, copy or
deliver this message.Please notify the sender immediately by e-mail if
you have received this e-mail by mistake and delete this e-mail from
your system.</b>
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: PK and FK relation ship
2003-09-11 06:45 PK and FK relation ship shyamperi@davlin.co.in
@ 2003-09-11 07:26 ` Peter Childs <blue.dragon@blueyonder.co.uk>
0 siblings, 0 replies; 2+ messages in thread
From: Peter Childs @ 2003-09-11 07:26 UTC (permalink / raw)
To: ; +Cc: pgsql-admin
On Thu, 11 Sep 2003 shyamperi@davlin.co.in wrote:
> Can any one tell me when would a primary key be refered to as foreign key in
> its own table.
>
Simple Trees.
If you need a parent child relationship the simplest way of
expressing it is to have a parent columnn and store the parent key in it.
If its null it must be the root.
Its really quite good for finding parents and children of a
record. (Children are "SELECT * from table where parent=<n.id>`;" parent
is "SELECT * from table where id=<n.parent>;")
Could also be used for storing a linked list or double linked
list.
Find any standard algorithims book and try and implement the lot
in a database. (Its not easy as SQL has a lot of missing features that
even C, C++ or even VB has!)
Peter Childs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2003-09-11 07:26 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-11 06:45 PK and FK relation ship shyamperi@davlin.co.in
2003-09-11 07:26 ` Peter Childs <blue.dragon@blueyonder.co.uk>
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