Re: max(*) - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: max(*)
Date
Msg-id 1148638188.7524.161.camel@localhost.localdomain
Whole thread Raw
In response to max(*)  (Dennis Bjorklund <db@zigo.dhs.org>)
Responses Re: max(*)
Re: max(*)
List pgsql-hackers
On Fri, 2006-05-26 at 10:22 +0200, Dennis Bjorklund wrote:
> Shouldn't
> 
>    SELECT max(*) FROM foo;
> 
> give an error? 

SQL:2003 would not allow this; SQL:2003 permits only COUNT(*) and no
other aggregate function. All other aggregates require a value
expression.

> Instead it's executed like
> 
>    SELECT max(1) FROM foo;
> 
> Just like count(*) is executed as count(1).
> 
> Something for the TODO or is it a feature?

Doesn't seem an important or even useful extension of the standard, but
would probably require special case processing for every aggregate
function in order to implement that. Its not dangerous... so I'm not
sure we should take any action at all.

--  Simon Riggs              EnterpriseDB   http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: XLogArchivingActive
Next
From: Andreas Pflug
Date:
Subject: Re: XLogArchivingActive