X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E481B9DC9E2 for ; Thu, 5 Jan 2006 07:39:22 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57666-05 for ; Thu, 5 Jan 2006 07:39:25 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail48.e.nsc.no (mail48.e.nsc.no [193.213.115.48]) by postgresql.org (Postfix) with ESMTP id 33A169DC9CE for ; Thu, 5 Jan 2006 07:39:19 -0400 (AST) Received: from [192.168.0.57] (062016183238.customer.alfanett.no [62.16.183.238]) (authenticated bits=0) by mail48.nsc.no (8.13.5/8.13.5) with ESMTP id k05BdLGg002892 for ; Thu, 5 Jan 2006 12:39:22 +0100 (CET) From: "Leif B. Kristensen" To: pgsql-sql@postgresql.org Subject: Re: FOREIGN KEYs ... I think ... Date: Thu, 5 Jan 2006 12:39:20 +0100 User-Agent: KMail/1.8.3 References: <20060104213210.A1088@ganymede.hub.org> <60352.66.190.208.241.1136433513.squirrel@www.hardgeus.com> In-Reply-To: <60352.66.190.208.241.1136433513.squirrel@www.hardgeus.com> X-Face: %iea8o"[SI'kMDS.`hz7lU=?\^lC9J-]CVjo; f{4-C:$?uVUEjyN~uYFn%*aH_c3d09U>=?utf-8?q?x=0A=09TXtaoj=7EMV=2E8PgG7hik9=3BcCT2N6+u?=@Y{wH\p3*_f~FH9k,Wi74e[_l%.7b^'zJ)8S'^G<(=?utf-8?q?=3D=0A=09zw8=5CPMC3=27=7BKl9=2EzL*ks!b6wA?=,c~'F`k&Vq|ELDGa|4 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200601/24 X-Sequence-Number: 23813 On Thursday 05 January 2006 04:58, nospam@hardgeus.com wrote: >That's not what foreign keys do. The only thing a foreign key > provides is a guarantee that if any records in B (the referencing > table) still reference a record in table A (the referenced table) > then you cannot delete that referenced record. Just a little nitpick: A foreign key will also guarantee that you can't insert or update records with an fk in the referencing table that doesn't match one already entered into the referenced table. -- Leif Biberg Kristensen | Registered Linux User #338009 http://solumslekt.org/ | Cruising with Gentoo/KDE