Anyone want to comment on this one? Just tested with v6.5.0 and it still
exists there...
vhosts=> create table test ( a int, b char );
CREATE
vhosts=> insert into test values ( 1, 'a' );
INSERT 149258 1
vhosts=> select a from test group by a having a > 0;
ERROR: SELECT/HAVING requires aggregates to be valid
On Tue, 5 Oct 1999, Luuk de Boer wrote:
> On 4 Oct 99, at 21:18, Bruce Momjian wrote:
>
> > > <cut>
> > >
> > > > However, this is an old recollection, and I see on the current page that
> > > > this is no longer the case. The current page looks much better, though
> > > > somehow you show PostgreSQL doesn't have HAVING or support -- comments.
> > > > However, I realize such a test is a major project, and you are not going
> > > > to get everything right.
> > >
> > > ps. I removed all the mailnglists to discuss some little things ...
> > >
> > > hmmm do you mean having is now supported in postgresql. The
> > > latest run of crash-me which I watched (last week I believe with
> > > version 6.5.1) I believe I saw the message HAVING still not
> > > supported in postgresql. Is that correct or did I do something wrong
> > > with compiling postgres (just followed the normal procedure as
> > > stated in the INSTALL file.
> >
> > We have had HAVING since 6.3.* as I remember.
>
> I looked into it this morning and found the following thing why crash-
> me is saying that having is not supported.
> We have a table (crash_me) with two columns (a (int)and b (char))
> which are filled with one entry (1 and 'a').
> The following thing is comming back to me ...
> query3: select a from crash_me group by a having
> a > 0
>
> Got error from query: 'select a from crash_me
> group by a having a > 0'
> ERROR: SELECT/HAVING requires aggregates to be
> valid
>
> Checking connection
> Having: no
> Having with group function: query1: select a
> from crash_me group by a having count(*) = 1
> ...(53)
> yes
> Order by alias: yes
> Having on alias: query1: select a as ab from
> crash_me group by a having ab > 0
> ...(53)
>
> Got error from query: 'select a as ab from
> crash_me group by a having ab > 0'
> ERROR: attribute 'ab' not found
>
> Checking connection
> no
>
> We had an if structure around testing having with group function if
> having was supported and that if structure I removed.
> Could you explain to me what's wrong to the above queries?
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org