Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id AAA65420 for ; Thu, 1 Jun 2000 00:37:50 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id AAA13149; Thu, 1 Jun 2000 00:37:12 -0400 (EDT) To: "Alexander H. Iliev" cc: pgsql-sql@postgresql.org Subject: Re: question on diagnostics In-reply-to: <200006010312.XAA17634@nimbus.dartmouth.edu> References: <200006010312.XAA17634@nimbus.dartmouth.edu> Comments: In-reply-to "Alexander H. Iliev" message dated "Wed, 31 May 2000 23:12:54 -0400" Date: Thu, 01 Jun 2000 00:37:11 -0400 Message-ID: <13146.959834231@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200006/1 "Alexander H. Iliev" writes: > does anyone have a clue what this diagnostic from psql (v 7.0) means: > ERROR: aggregate function in qual must be argument of boolean operator Aggregates and GROUP BY in views have a lot of restrictions at the moment, and this is one of them: the rewriter has a problem with figuring out how to substitute "MAX(date)" for "last_payment.date" in the context of your age() function call. We're planning a thorough rewrite of the view-supporting code for 7.2, and most of these problems should go away at that point. In the short run you would be well advised to avoid grouped views except in the simplest contexts. I think this example could be rewritten with no view, or you could push the "date_part(...)" call into the view as another column. > oh, btw this select refused to use an SQL natural join among the 3 > relations - the server gives up and disconnects without warning. That sounds like a garden-variety bug. I'd be willing to look at it if I had a complete example to follow, but I don't want to try to reverse-engineer your table definitions... regards, tom lane