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 8B6E09DCB62 for ; Mon, 27 Mar 2006 09:52:19 -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 63404-03 for ; Mon, 27 Mar 2006 09:52:22 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 48FD29DCBC1 for ; Mon, 27 Mar 2006 09:52:16 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id 4C29856423; Mon, 27 Mar 2006 07:52:21 -0600 (CST) Received: (hashcash-sendmail, from uid 1001); Mon, 27 Mar 2006 07:52:20 -0600 Date: Mon, 27 Mar 2006 07:52:19 -0600 From: "Jim C. Nasby" To: PFC Cc: "D'Arcy J.M. Cain" , Todd Kennedy , pgsql-sql@postgresql.org Subject: Re: Question about One to Many relationships Message-ID: <20060327135219.GL80726@pervasive.com> References: <226d83de0603240852q54af3512odfce218d69718c8b@mail.gmail.com> <20060324120142.d3fdf477.darcy@druid.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060327:lists@peufeu.com::hemRUS7tPIqcLoqU:04py7 X-Hashcash: 1:20:060327:darcy@druid.net::2gW0g4L+I7tyjGah:008gAL X-Hashcash: 1:20:060327:todd.kennedy@gmail.com::h6S6ZTM6A+0dpMW8:000000000000000 0000000000000000000000001BAb X-Hashcash: 1:20:060327:pgsql-sql@postgresql.org::pMI9NUEPwiQ+Zn4V:0000000000000 00000000000000000000000022Cq X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.109 required=5 tests=[AWL=0.109] X-Spam-Score: 0.109 X-Spam-Level: X-Archive-Number: 200603/417 X-Sequence-Number: 24763 On Fri, Mar 24, 2006 at 06:29:25PM +0100, PFC wrote: > > > >>And I want to link the band to the album, but, if the album is a > >>compilation it'll be linked to multiple band.ids, so i can't just add > >>a column like: > > For a compilation, you should link a band to a track, not an album. > This opens another can of worms... > > I would use the following tables : BTW, if you're going to be writing code to manage stuff like this, you should absolutely check out the source for http://musicbrainz.org/, which uses PostgreSQL as it's backend. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461