X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 55691D1C4D6 for ; Wed, 30 Jul 2003 19:39:37 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 83413-07 for ; Wed, 30 Jul 2003 16:38:35 -0300 (ADT) Received: from megazone.bigpanda.com (unknown [66.180.233.26]) by svr1.postgresql.org (Postfix) with ESMTP id 8B656D1C4D5 for ; Wed, 30 Jul 2003 16:39:35 -0300 (ADT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 82777D703; Wed, 30 Jul 2003 12:39:35 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 69DDD5C12; Wed, 30 Jul 2003 12:39:35 -0700 (PDT) Date: Wed, 30 Jul 2003 12:39:35 -0700 (PDT) From: Stephan Szabo To: Jamie Lawrence Cc: Subject: Re: Fwd: Bad Join moment - how is this happening? In-Reply-To: <20030730200732.GW1073@jal.clueinc.net> Message-ID: <20030730123546.X39594-100000@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/468 X-Sequence-Number: 14582 On Wed, 30 Jul 2003, Jamie Lawrence wrote: > I have a view: > > create or replace view addenda as > select > documents.id, > documents.oid, > documents.projects_id, > documents.doc_num, > documents.description, > documents.date, > documents.createdate, > documents.moddate, > documents.people_id, > documents.parent, > documents.document_type, > documents.state, > documents.machines_id, > documents.phases_id, > > d_addenda.item_num, > d_addenda.drawing_reference > > from > d_addenda as a, documents as d > where a.documents_id = d.id; I think you're being bitten by from clause addition. You're referencing documents in the select list rather than d so it's probably adding an unconstrained join to documents.