Thread: Bug: COUNT() and ExecEvalAggref error

Bug: COUNT() and ExecEvalAggref error

From
Dan Lyke
Date:
I've looked through my archives of pgsql-general and pgsql-hackers and
haven't seen this, but I do tend to flush the deleted messages
occasionally. I'm trying to get a build off the current CVS tree, but
my working build is from Sunday evening, so I feel moderately current.

Two builds of 7.1beta4 from the CVS tree. The one on my production
machine was built January 29, the one on my development machine was
built from sources gotten Sunday evening.

When I do this:
  $ /usr/local/pgsql/bin/createdb test  $ /usr/local/pgsql/bin/psql test      test=# create table abc (id serial, stuff
text); test=# insert into abc (stuff) values ('xyz');  test=# insert into abc (stuff) values ('xyz');  test=# insert
intoabc (stuff) values ('xyz');  test=# insert into abc (stuff) values ('qrs');  test=# insert into abc (stuff) values
('qrs'); test=# insert into abc (stuff) values ('qrs');  test=# insert into abc (stuff) values ('qrs');  test=# insert
intoabc (stuff) values ('qrs');  test=# select count(id) from abc;
 

On my production machine (PosgreSQL built from CVS on January 29) I
get the expected result:
   count   -------     8  (1 row)

On my development machine (Built from CVS late Sunday, February 18), I
get:
  test=# select count(id) from abc;  ERROR:  ExecEvalAggref: no aggregates in this expression context  test=# 

Apologies if this has gone by already, I'm in the process of trying to
get an absolutely current CVS update to build and if anyone's got
suggestions on where to start before I dive into the PostgreSQL code
whole hog for the first time I'd sure appreciate it.

Don't think it matters, but just in case, development box is:
 Linux wynand 2.2.17 #7 Wed Nov 8 09:47:05 PST 2000 i586 unknown

Production server, and the machine that the production server binaries
were built on, both of which work:
 Linux mail 2.2.12 #6 Tue Jan 18 17:49:47 PST 2000 i586 unknown Linux francon 2.2.18 #2 SMP Sun Jan 28 20:10:18 PST
2001i686 unknown
 

All using libc-2.1.3.so

Dan


Re: Bug: COUNT() and ExecEvalAggref error

From
Tom Lane
Date:
Dan Lyke <danlyke@flutterby.com> writes:
> On my development machine (Built from CVS late Sunday, February 18), I
> get:

>    test=# select count(id) from abc;
>    ERROR:  ExecEvalAggref: no aggregates in this expression context

Try make distclean, configure, make all.  Someone else reported this
same symptom recently due to having inconsistent object files.

In general, anytime you do "cvs update", the safest approach is a make
distclean and full rebuild.  If you have not enabled dependency tracking
then that's the *only* procedure that will work reliably.  If you do
use --enable-depend then you may be able to get away with partial
rebuilds, but I don't trust that feature myself.  I figure I can do an
awful lot of automatic rebuilds in the time it will cost me to track
down even one "bug" caused by inconsistent files.
        regards, tom lane