Subject: Limit to where clause length???????

From: [email-masked]
Date: Tue, 4 Oct 1994 21:10:52 -0400 (EDT)

I am attempting to execute a query over several tables by stringing
together a where clause that match the correct attributes in each of
four tables.  

If I execute the following query, I get back a 10 tuples.

retrieve (models.all) where langLinks.source = models.id
	and langLinks.title = "Universal"

However, when I execute the following query, I get back an empty table.

retrieve (model.all) where (lang.Links.source = models.id 
	and langLinks.title = "Universal") or 
	(partLinks.source = models.id and partLinks.title = "Universal") or
	(userLinks.source = models.id and userLinks.title = "Universal") or
	(opLinks.source = models.id and opLinks.title = "Universal")

Why doesn't this query find the same tuples the first one finds?

Thanks,
Robert

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]"

   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================

---

From: [email-masked]
Date: Tue, 4 Oct 1994 22:10:12 -0400 (EDT)

It seems that the limit is not on the actual length of the where clause
but on the number of tables which can be referenced by one query (at
least in the where clause).

It appears that I can execute any combination of and's and or's in a
where clause as long as I don't access more than 3 tables.  The minute I
try to access 4 tables, even in a simpler query, Postgres simply returns
an empty table, even if there are tuples which match the query.

Robert

---

From: [email-masked] (Paul M. Aoki)
Date: Tue, 04 Oct 94 23:02:28 -0700

> an empty table, even if there are tuples which match the query.

src/examples/chapter15 contains several four-way joins.

there is no hardwired limit on the number of tables that you can 
reference in a query, though (as recently mentioned) there are some 
8kb buffers awaiting the unwary.
--
  Paul M. Aoki          |  University of California at Berkeley
  [email-masked]  |  Dept. of EECS, Computer Science Division (#1776) 
                        |  Berkeley, CA 94720-1776