Re: [GENERAL] Re: [PHP3] Re: PostgreSQL vs Mysql comparison - Mailing list pgsql-hackers

From The Hermit Hacker
Subject Re: [GENERAL] Re: [PHP3] Re: PostgreSQL vs Mysql comparison
Date
Msg-id Pine.BSF.4.10.9910050851050.17532-100000@thelab.hub.org
Whole thread Raw
Responses Re: [HACKERS] Re: [GENERAL] Re: [PHP3] Re: PostgreSQL vs Mysql comparison  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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 



pgsql-hackers by date:

Previous
From: "Geeta Mahesh"
Date:
Subject: initdb problem on sun solaris sparc
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] How to add a new build-in operator