From shyamperi@davlin.co.in Thu Sep 11 07:08:26 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 1DADED1B4F9 for ; Thu, 11 Sep 2003 07:08:26 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 65747-09 for ; Thu, 11 Sep 2003 04:07:53 -0300 (ADT) Received: from davlin.co.in (ns.vasnet.net.in [202.4.160.11]) by svr1.postgresql.org (Postfix) with ESMTP id 8FF14D1B4E6 for ; Thu, 11 Sep 2003 04:07:51 -0300 (ADT) Received: from Application (unknown [202.4.160.30]) by davlin.co.in (Postfix) with ESMTP id 73E0514B94 for ; Thu, 11 Sep 2003 12:15:59 +0530 (IST) Message-ID: <5382364.1063263201059.JavaMail.tomcat@mail.davlin.co.in> From: shyamperi@davlin.co.in To: pgsql-admin@postgresql.org Subject: PK and FK relation ship Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_231_3896403.1063263200914" Date: Thu, 11 Sep 2003 12:15:59 +0530 (IST) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/178 X-Sequence-Number: 10266 ------=_Part_231_3896403.1063263200914 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Can any one tell me when would a primary key be refered to as foreign key in its own table. ----- Warm Regards Sh=FFam Peri II Floor, Punja Building, M.G.Road, Ballalbagh, Mangalore-575003=20 Ph : 91-824-2451001/5 Fax : 91-824-2451050=20 DISCLAIMER: This message contains privileged and confidential information a= nd 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. ------=_Part_231_3896403.1063263200914 Content-type: text/html Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=Untitled1 Can any one tell me when would a primar= y key be refered to as foreign key in
its own table.

-----
Warm Regards
Sh=FFam Peri

II Floor, Punja Building,
M.G.Road,
Ballalbagh,
Mangalore-575003=20
Ph : 91-824-2451001/5
Fax : 91-824-2451050=20




DISCLAIMER: This message contains privileged and confidential information a= nd 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. ------=_Part_231_3896403.1063263200914-- From blue.dragon@blueyonder.co.uk Thu Sep 11 07:26:48 2003 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 34083D1B50D for ; Thu, 11 Sep 2003 07:26:48 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 83615-02 for ; Thu, 11 Sep 2003 04:26:38 -0300 (ADT) Received: from smtp.blueyonder.co.uk (82-34-96-210.cable.ubr06.gill.blueyonder.co.uk [82.34.96.210]) by svr1.postgresql.org (Postfix) with ESMTP id 75F0CD1B4E8 for ; Thu, 11 Sep 2003 04:26:36 -0300 (ADT) Received: from reddragon.localdomain ([127.0.0.1] helo=localhost) by smtp.blueyonder.co.uk with esmtp (Exim 4.10) id 19xLqe-00075G-00 for pgsql-admin@postgresql.org; Thu, 11 Sep 2003 08:26:37 +0100 Date: Thu, 11 Sep 2003 08:26:36 +0100 (BST) From: Peter Childs X-X-Sender: peter@RedDragon.Childs Cc: pgsql-admin@postgresql.org Subject: Re: PK and FK relation ship In-Reply-To: <5382364.1063263201059.JavaMail.tomcat@mail.davlin.co.in> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/179 X-Sequence-Number: 10267 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=`;" parent is "SELECT * from table where id=;") 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