Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id C356A9FA176 for ; Wed, 17 Jan 2007 07:04:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 80398-08 for ; Wed, 17 Jan 2007 07:03:17 -0400 (AST) X-Greylist: delayed 00:06:39.143567 by SQLgrey-1.7.4 Received: from correo1.acens.net (correo1.acens.net [217.116.0.33]) by postgresql.org (Postfix) with ESMTP id A8C3C9FA621 for ; Wed, 17 Jan 2007 07:03:19 -0400 (AST) Received: (qmail 31806 invoked from network); 17 Jan 2007 10:56:35 -0000 Received: from unknown (HELO albert.sedifa.com) ([83.175.220.10]) (envelope-sender ) by correo1.acens.net (qmail-ldap-1.03) with SMTP for ; 17 Jan 2007 10:56:35 -0000 From: Albert Cervera Areny Organization: Sedifa, S.L. To: pgsql-performance@postgresql.org Subject: Re: Table Inheritence and Partioning Date: Wed, 17 Jan 2007 12:01:51 +0100 User-Agent: KMail/1.9.5 References: <47230CE166B64744B0120173E4C2161EED8457@BLR-EC-MBX01.wipro.com> In-Reply-To: <47230CE166B64744B0120173E4C2161EED8457@BLR-EC-MBX01.wipro.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200701171201.51683.albert@sedifa.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1 tagged_above=0 required=5 tests=BAYES_60 X-Spam-Level: * X-Archive-Number: 200701/253 X-Sequence-Number: 22854 Currently foreign keys don't work that way. You will need your data to be i= n=20 table persons if you want the foreign key to work correctly. Otherwise you= =20 could create your own trigger to ensure the foreign key restriction you nee= d. I'm no expert at all and it seems there are non trivial issues that have to= be=20 solved in order to make foreign keys behave in the way you'd expect. A Dimecres 17 Gener 2007 11:42, ramachandra.bhaskaram@wipro.com va escriure: > Hi, > > We are having 3 tables; > 1. persons <-- Base table and no data will be inserted in this table. > 2. Person1 <-- Inherited table from persons all data will be inserted in > this table. 3. PersonalInfo <-- which is storing all personal information > of the persons and is having the foreign key relationship with the persons > table. > > When we try to insert the data in the personalInfo table it is throwing t= he > error stating the primary key does not contain the given value. But, if= I > try to select from the persons table it is showing the records from its > inherited tables as well. Can anybody tell me what might be the probl= em > here? Or else any help regarding the same will be of very much help. > > Following is the table structure; > --------------------------------------------------------------------- > Create Table persons ( > name varchar, > age int, > dob varchar, > constraint pKey primary key(name) > ); > create table person1 ( ) inherits(persons); > > Create table personalInfo ( > name varchar, > contact_id int, > contact_addr varchar, > constraint cKey primary key(contact_id), > constraint fKey foreign key(name) references persons(name) > ); > -------------------------------------------------------------------------= =2D- >----------------------- > > Thanks In Advance, > Ramachandra B.S. > > > > The information contained in this electronic message and any attachments = to > this message are intended for the exclusive use of the addressee(s) and m= ay > contain proprietary, confidential or privileged information. If you are n= ot > the intended recipient, you should not disseminate, distribute or copy th= is > e-mail. Please notify the sender immediately and destroy all copies of th= is > message and any attachments. > > WARNING: Computer viruses can be transmitted via email. The recipient > should check this email and any attachments for the presence of viruses. > The company accepts no liability for any damage caused by any virus > transmitted by this email. > > www.wipro.com =2D-=20 Albert Cervera Areny Dept. Inform=E0tica Sedifa, S.L. Av. Can Bordoll, 149 08202 - Sabadell (Barcelona) Tel. 93 715 51 11 =46ax. 93 715 51 12 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2E....................... AVISO LEGAL ............................ La presente comunicaci=F3n y sus anexos tiene como destinatario la persona a la que va dirigida, por lo que si usted lo recibe por error debe notificarlo al remitente y eliminarlo de su sistema, no pudiendo utilizarlo, total o parcialmente, para ning=FAn fin. Su contenido puede tener informaci=F3n confidencial o protegida legalmente y =FAnicamente expresa la opini=F3n del remitente. El uso del correo electr=F3nico v=EDa Internet no permite asegurar ni la confidencialidad de los mensajes ni su correcta recepci=F3n. En el caso de que el destinatario no consintiera la utilizaci=F3n del correo electr=F3nico, deber=E1 ponerlo en nuestro conocimiento inmediatamente. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2E.......................... DISCLAIMER ............................. This message and its attachments are intended exclusively for the named addressee. If you receive this message in error, please immediately delete it from your system and notify the sender. You may not use this message or any part of it for any purpose. The message may contain information that is confidential or protected by law, and any opinions expressed are those of the individual sender. Internet e-mail guarantees neither the confidentiality nor the proper receipt of the message sent. If the addressee of this message does not consent to the use of internet e-mail, please inform us inmmediately. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20