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 4851AD1C50C for ; Thu, 31 Jul 2003 09:30:26 +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 36778-03 for ; Thu, 31 Jul 2003 06:29:23 -0300 (ADT) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by svr1.postgresql.org (Postfix) with SMTP id 71B0FD1C510 for ; Thu, 31 Jul 2003 06:30:23 -0300 (ADT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Thu Jul 31 11:30:04 2003 +0200 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id LAA28923; Thu, 31 Jul 2003 11:30:03 +0200 (METDST) Message-ID: <3F28E19A.1D589548@rodos.fzk.de> Date: Thu, 31 Jul 2003 11:30:03 +0200 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: postgres@jal.org, pgsql-sql@postgresql.org Subject: Re: Fwd: Bad Join moment - how is this happening? Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Amavis-Alert: BAD HEADER Non-encoded 8-bit data (char 9C hex) in message header 'Received' Received: \234by rodos.fzk.de... ^ X-Archive-Number: 200307/483 X-Sequence-Number: 14597 > 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; > Doing this you should have got NOTICE: Adding missing FROM-clause entry for table "d_addenda" NOTICE: Adding missing FROM-clause entry for table "documents" So it's pretty useful to write psql's output to a file when creating relations and check for NOTICE messages. exec 3>/tmp/psql.out;$PGSQLD/bin/psql 1>&3 2>&3 NOTICE messages appear to be sent to stderr. As the previous posters already made clear 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 , documents where d_addenda.documents_id = documents.id; resp. create or replace view addenda as select d.id, d.oid, d.projects_id, d.doc_num, d.description, d.date, d.createdate, d.moddate, d.people_id, d.parent, d.document_type, d.state, d.machines_id, d.phases_id, a.item_num, a.drawing_reference from d_addenda as a, documents as d where a.documents_id = d.id; should match your intentions. Regards, Christoph