pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Andrei Lepikhov <lepihov@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Chao Li <li.evan.chao@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: David Rowley <dgrowleyml@gmail.com>
Subject: Re: Make the transition state of avg(int2)/avg(int4)/sum(int2)/sum(int4) internal
Date: Fri, 04 Sep 2026 11:50:22 -0400
Message-ID: <1571559.1788537022@sss.pgh.pa.us> (raw)
In-Reply-To: <q2ksopavjswuwybvw643w652s374eqv2rnamtelaueyt4nfbqm@5vjzkkuujv33>
References: <762e811a-6584-4b03-a6ca-52600adcd6e9@gmail.com>
	<q2ksopavjswuwybvw643w652s374eqv2rnamtelaueyt4nfbqm@5vjzkkuujv33>

Andres Freund <andres@anarazel.de> writes:
> Seems like if we do this - and I think we should - we should go broader than
> just doing this for int8[]. So yea, let's do it for float8 too.
> I think it might make sense to have an opr_sanity.sql check that verifies that
> we don't add new builtin aggregates that have an array transition state. Or
> perhaps even more strictly, test that aggregates either have an internal
> transition state, or the argument type's (for stuff like min/max).

On reflection, I'm not sure that such a policy is a win.  If you go
with an internal-type transition state, then (if you want parallel
aggregation support) you need serialize/deserialize functions, and
I think also some other stuff that comes for free if the transition
state is a real SQL type.  So this is not so much a clear win as
a tradeoff of which code you want to write.

			regards, tom lane






view thread (4+ messages)  latest in thread

Message-ID: <1571559.1788537022@sss.pgh.pa.us>
Permalink:  ../1571559.1788537022@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1571559.1788537022@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, lepihov@gmail.com, li.evan.chao@gmail.com, michael@paquier.xyz, dgrowleyml@gmail.com
  Subject: Re: Make the transition state of avg(int2)/avg(int4)/sum(int2)/sum(int4) internal
  In-Reply-To: <1571559.1788537022@sss.pgh.pa.us>
  References: <762e811a-6584-4b03-a6ca-52600adcd6e9@gmail.com> <q2ksopavjswuwybvw643w652s374eqv2rnamtelaueyt4nfbqm@5vjzkkuujv33> <1571559.1788537022@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox