Re: ERROR: ExecEvalAggref: no aggregates in this expressioncontext - Mailing list pgsql-sql

From Paul McGarry
Subject Re: ERROR: ExecEvalAggref: no aggregates in this expressioncontext
Date
Msg-id 3963DA0C.B248C79D@opentec.com.au
Whole thread Raw
In response to ERROR: ExecEvalAggref: no aggregates in this expression context  (Paul McGarry <paulm@opentec.com.au>)
Responses Re: ERROR: ExecEvalAggref: no aggregates in this expressioncontext
List pgsql-sql
Hi Tom,

Tom Lane wrote:
> > ERROR: ExecEvalAggref: no aggregates in this expression context
> > Does it mean that there aren't any aggregate in the expression
> > context when there should be.
> Yup.  ExecEvalAggref is supposed to fetch the result of a (previously
> computed) aggregate function.  It's unhappy because it's not finding
> anything to return.  This is a bug --- can we see a complete example
> that causes it?

The view that I am experiencing this error on is rather nasty, so
much so that I am going to solve the problem it was supposed to
solve in another way.

On another (possibly related) note, the same view seems to pose
problems when I do a 'SELECT count(*) from view_name'.

If I do a 'SELECT * from view_name' and get 8 rows of data, when Ido a 'SELECT count(*) from view_name' I get 8 rows of
the
 
number 1 returned. 

In any case I'll try and distill both of these down to a slightly 
less horrific testcase and send it in.

-- 
Paul McGarry            mailto:paulm@opentec.com.au 
Systems Integrator      http://www.opentec.com.au 
Opentec Pty Ltd         http://www.iebusiness.com.au
6 Lyon Park Road        Phone: (02) 9878 1744 
North Ryde NSW 2113     Fax:   (02) 9878 1755


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERROR: ExecEvalAggref: no aggregates in this expression context
Next
From: Paul McGarry
Date:
Subject: Re: ERROR: ExecEvalAggref: no aggregates in thisexpressioncontext