pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rosser Schwarz <rosser.schwarz@gmail.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Order of items in FROM causes error?
Date: Fri, 1 Apr 2005 10:24:12 -0600
Message-ID: <37d451f705040108246e6be935@mail.gmail.com> (raw)

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



view thread (3+ messages)  latest in thread

Message-ID: <37d451f705040108246e6be935@mail.gmail.com>
Permalink:  ../37d451f705040108246e6be935@mail.gmail.com/
Also on:    postgresql.org/message-id/37d451f705040108246e6be935@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rosser.schwarz@gmail.com
  Subject: Re: Order of items in FROM causes error?
  In-Reply-To: <37d451f705040108246e6be935@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox