X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0BB2ED1B33D for ; Sun, 20 Jun 2004 18:22:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48804-09 for ; Sun, 20 Jun 2004 21:22:17 +0000 (GMT) Received: from web11.manitu.net (web11.manitu.net [217.11.48.111]) by svr1.postgresql.org (Postfix) with ESMTP id 694CAD1B1CD for ; Sun, 20 Jun 2004 18:22:13 -0300 (ADT) Received: from [192.168.0.1] (dsl-082-082-202-111.arcor-ip.net [82.82.202.111]) (authenticated) by web11.manitu.net (8.10.2-SOL3/8.10.2) with ESMTP id i5KLM6a26464 for ; Sun, 20 Jun 2004 23:22:06 +0200 Subject: question about which column(s) are the right foreign key From: Markus Bertheau To: pgsql-sql@postgresql.org Content-Type: text/plain; charset=UTF-8 Message-Id: <1087766532.2660.27.camel@teetnang> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Sun, 20 Jun 2004 23:22:13 +0200 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/171 X-Sequence-Number: 18116 Hi, I have objects in my database, and they have an object id generated with a sequence. Then I have object versions. The ids of object versions need to be unique only within one object id. But for simplicity they're generated with a sequence, too. Now I want to reference an object version. I can use just the object version id, because it "happens" to be globally unique. Conceptually though, I should use the object's id and its version's id. Now redundancy is Not Good=E2=84=A2, so I wonder which way is the Right One= =E2=84=A2. I understand that both ways work and that the variant with just the object id is probably both faster and smaller. I'd be thankful for enlightenment :) --=20 Markus Bertheau