Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7FEB14771E9 for ; Wed, 15 Jan 2003 18:54:23 -0500 (EST) Received: from ece.rice.edu (ece.rice.edu [128.42.4.34]) by postgresql.org (Postfix) with ESMTP id 66FC3476626 for ; Wed, 15 Jan 2003 17:54:43 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by ece.rice.edu (Postfix) with SMTP id 8FAC968A88; Wed, 15 Jan 2003 16:54:45 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by ece.rice.edu (Postfix) with ESMTP id 37EB068A86; Wed, 15 Jan 2003 16:54:45 -0600 (CST) Received: from wallace.ece.rice.edu (wallace.ece.rice.edu [128.42.12.154]) by ece.rice.edu (Postfix) with ESMTP id 6C7EA68A1D; Wed, 15 Jan 2003 16:54:44 -0600 (CST) Received: from reedstrm by wallace.ece.rice.edu with local (Exim 3.36 #1 (Debian)) id 18YwQm-00082c-00; Wed, 15 Jan 2003 16:54:44 -0600 Date: Wed, 15 Jan 2003 16:54:44 -0600 From: "Ross J. Reedstrom" To: Matthew Nuzum Cc: 'Tomasz Myrta' , pgsql-sql@postgresql.org Subject: Re: lost on self joins Message-ID: <20030115225444.GB29593@wallace.ece.rice.edu> Mail-Followup-To: "Ross J. Reedstrom" , Matthew Nuzum , 'Tomasz Myrta' , pgsql-sql@postgresql.org References: <3E25BDAF.8060109@klaster.net> <003101c2bcd3$720ab1a0$6700a8c0@mattspc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003101c2bcd3$720ab1a0$6700a8c0@mattspc> User-Agent: Mutt/1.4i X-Virus-Scanned: by AMaViS snapshot-20020300 X-DCC--Metrics: ece.rice.edu 1067; Body=1 Fuz1=1 Fuz2=1 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/241 X-Sequence-Number: 11106 On Wed, Jan 15, 2003 at 03:19:38PM -0500, Matthew Nuzum wrote: > > -----Original Message----- > > From: Tomasz Myrta [mailto:jasiek@klaster.net] > > Sent: Wednesday, January 15, 2003 3:00 PM > > To: Matthew Nuzum > > Cc: pgsql-sql@postgresql.org > > Subject: Re: [SQL] lost on self joins > > >Finaly, a table to allow a many to many join called files_folders > > > | files_folders > > >================ > > >x| ffid > > > | folderid (fk to folders.folderid) > > > | fileid (fk to files.fileid) > > > > Strange. Do you need this table? Can one file exist in several > > directories? > > If not, you can just add "folderid" field into table files. > > Good point. No, it can't exist in multiple folders, so I guess it's > overkill to do a many to many here. Thanks for the moment of clarity. Unless you're attempting to accurately map Unix filesystem sematics, where the exact same file _can_ be in more than one place in the filesystem (hard links). It's all about the inode. One of the wierder bits of unix that you don't often see used in common occurances. Ross