From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>
Cc: Kirill Zdornyy <kirill@dineserve.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: Error from array_agg when table has many rows
Date: Sun, 09 Mar 2025 13:14:53 -0400
Message-ID: <397017.1741540493@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvrsJ6qhgpjW2HNe8UbDkzZOdKQ=rDjeynswnce7LtWCxQ@mail.gmail.com>
References: <atLI5Kce2ie1zcYjU0w_kjtVaxiYbYGTihrkLDmGZQnRDD4pnXukIATaABbnIj9pUnelC4ESvCXMm4HAyHg-v61XABaKpERj0A2IXzJZM7g=@dineserve.com>
<CAMbWs49WUftz6gXGPSVrZJ0czZ1RCtQz4RxDZKEKZtYADvA6Sw@mail.gmail.com>
<1297401.1741449001@sss.pgh.pa.us>
<CAApHDvrsJ6qhgpjW2HNe8UbDkzZOdKQ=rDjeynswnce7LtWCxQ@mail.gmail.com>
David Rowley <dgrowleyml@gmail.com> writes:
> On Sun, 9 Mar 2025 at 04:50, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Yeah. I don't think there is any way for array_agg_deserialize to
>> know the correct typmod, so what we have to do is disable using
>> partial aggregation in this case. Fortunately there's a
>> policy-setting function that can be taught that, as attached.
> The only way I can think of to get that would be to special-case
> array_agg_serialize() to have it serialize the typmod when the send
> function is record_send(), then add a similar special-case to
> array_agg_deserialize() to check for a record_recv() and deserialize
> the typmod there. That doesn't seem very pretty, so I'm happy to go
> with your fix to disable parallel aggregates for this case.
Yeah ... we could probably make that work if we had to, but the
ugliness would likely metastasize outside array_agg_[de]serialize.
Since it took more than a year to get a field report, I'm content
to just disable the optimization instead. Pushed that way.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, guofenglinux@gmail.com, kirill@dineserve.com, pgsql-bugs@lists.postgresql.org
Subject: Re: Error from array_agg when table has many rows
In-Reply-To: <397017.1741540493@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