John McCawley <nospam@xxxxxxxxxxxx> writes: > My development machine is PostgreSQL 8.1.5, and my production machine is > PostgreSQL 8.2. Until now I haven't run into any differences in > behavior. I have a query with a relatively wacky join, and while it was > working on my development machine, it wouldn't work on the production > machine. The query is as follows: Is this 8.2.0? Because the query seems to match the conditions for this 8.2.1 bug fix: 2006-12-07 14:33 tgl * src/backend/optimizer/plan/: initsplan.c (REL8_2_STABLE), initsplan.c: Repair incorrect placement of WHERE clauses when there are multiple, rearrangeable outer joins and the WHERE clause is non-strict and mentions only nullable-side relations. New bug in 8.2, caused by new logic to allow rearranging outer joins. Per bug #2807 from Ross Cohen; thanks to Jeff Davis for producing a usable test case. regards, tom lane