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 90FC65334C for ; Fri, 1 Apr 2005 17:24:22 +0100 (BST) 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 79753-06 for ; Fri, 1 Apr 2005 16:24:14 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.207]) by svr1.postgresql.org (Postfix) with ESMTP id E863A53207 for ; Fri, 1 Apr 2005 17:24:13 +0100 (BST) Received: by wproxy.gmail.com with SMTP id 68so1011554wri for ; Fri, 01 Apr 2005 08:24:13 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=MtsbR05en3N25/xFDVo7Y0vb5gxw+QCIGwppF7LIum5IwoifsRfvI1ogKiuRCBIXs9SnKRXi1bBw6aGCJRCklsB7Jnic++OSwx0/zLVLWrR2Oo/WK+h5yo5Ya6aa5GpszKAHznFR4hLlL45IOYcks9WELJBCfFwDWNSyh45hNu8= Received: by 10.54.7.4 with SMTP id 4mr1067548wrg; Fri, 01 Apr 2005 08:24:13 -0800 (PST) Received: by 10.54.102.17 with HTTP; Fri, 1 Apr 2005 08:24:12 -0800 (PST) Message-ID: <37d451f705040108246e6be935@mail.gmail.com> Date: Fri, 1 Apr 2005 10:24:12 -0600 From: Rosser Schwarz Reply-To: Rosser Schwarz To: "pgsql-sql@postgresql.org" Subject: Order of items in FROM causes error? Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.458 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP, TO_ADDRESS_EQ_REAL X-Spam-Level: X-Archive-Number: 200504/13 X-Sequence-Number: 20906 A colleague has the following query, which errors with: relation "dl" does not exist. (See the second item in the FROM clause.) If that item is moved to immediately precede the first JOIN item however, the query works as expected. select u.usersfirstname || ' ' || u.userslastname as userssupervisorsname , l.locationsname || ' >> ' || lv.listvaluesname as locationdepartment , lvcat.listvaluesname as usersemploymentcategory , lvclass.listvaluesname as usersemploymentclass , lvacdcat.listcategoriesname as usersacdcategory from intranet.tbl_users u , intranet.tbl_departmentslocations dl , intranet.tbl_listvalues lvcat , intranet.tbl_listvalues lvclass , intranet.tbl_listcategories lvacdcat join intranet.tbl_listvalues lv on dl.listvaluesid = lv.listvaluesid join intranet.tbl_locations l on dl.locationsid = l.locationsid where u.usersid = 199 and dl.listvaluesid = 13 and lvcat.listvaluesid = 23 and lvclass.listvaluesid = 27 and lvacdcat.listcategoriesid = 6 This strikes me as a bug. Is it known behavior? A quick search doesn't turn up much, but that may be a weakness in my google-fu. We're running 7.4.2. (Yes, I know; I'm about to start testing 8.0.2 on our new server.) /rls -- :wq