Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eALIJ7s15302 for ; Tue, 21 Nov 2000 13:19:07 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eALIGow02360; Tue, 21 Nov 2000 13:16:50 -0500 (EST) To: Kyle cc: pgsql-sql@postgresql.org Subject: Re: Problem with subquery joined to a view In-reply-to: <3A1AB618.E1B856FA@actarg.com> References: <3A1AB618.E1B856FA@actarg.com> Comments: In-reply-to Kyle message dated "Tue, 21 Nov 2000 10:51:20 -0700" Date: Tue, 21 Nov 2000 13:16:49 -0500 Message-ID: <2357.974830609@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200011/175 X-Sequence-Number: 206 Kyle writes: > The fourth "select" uses a regular subquery. It gives the error: > psql:datbug.sql:44: ERROR: Sub-SELECT uses un-GROUPed attribute > pay_req.wdate from outer query This appears to work correctly in current sources. In 7.0.* and before grouped views do not work very well, because the rewriter effectively expands them in-line, thus converting your outer query into a grouped query (or making it not work at all, if it was already grouped :-(). See related bug report just a few minutes ago on pgsql-bugs. regards, tom lane