Re: new aggregate functions v3 - Mailing list pgsql-patches

From Neil Conway
Subject Re: new aggregate functions v3
Date
Msg-id 40AB01B3.30401@samurai.com
Whole thread Raw
In response to new aggregate functions v3  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: new aggregate functions v3
List pgsql-patches
Fabien COELHO wrote:
> (1) boolean-and and boolean-or aggregates named bool_and and bool_or.
>     they (SHOULD;-) correspond to standard sql every and some/any aggregates.
>     they do not have the right name as there is a problem with
>     the standard and the parser for some/any. Tom also think that
>     the standard name is misleading because NULL are ignored.

As I understand it, there's an ambiguity issue with SOME/ANY, but not
with EVERY. If so, can we implement EVERY per-spec at least? It's okay
if we just add EVERY as an alias for BOOL_AND for the sake of homogeneity.

A few trivial points:

> + /* EVERY aggregate implementation conforming to SQL 2003 standard.
> +  * must be strict.
> +  */

This comment is misleading if we don't actually provide an
implementation of EVERY that conforms to spec. There's a similar comment
WRT to SOME/ANY.

> + PG_FUNCTION_INFO_V1(booland_statefunc);

Not needed for builtin functions (they are assumed to be V1).

> + /* what about every? */
> + DATA(insert OID = 2517 ( bool_and                        PGNSP PGUID 12 t f f f i 1 16 "16" _null_ aggregate_dummy
-_null_ )); 
> + DESCR("boolean-and aggregate");
> + /* what about any/some? */

Seems these questions should be removed, no?

-Neil


pgsql-patches by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: PITR Phase 1 - partial backport to 7.3.4, 7.3.5
Next
From: Fabien COELHO
Date:
Subject: Re: add build utilities in default install