On 2023-Sep-12, Tom Lane wrote:
> I'm more than a bit skeptical about trying to do something about this,
> simply because this range of query result sizes is far past what is
> practical. The OP clearly hasn't tested his patch on actually
> overflowing query results, and I don't care to either.
I think we're bound to hit this limit at some point in the future, and
it seems easy enough to solve. I propose the attached, which is pretty
much what Hongxu last submitted, with some minor changes.
Having this make a difference requires some 128GB of RAM, so it's not a
piece of cake, but it's an amount that can be reasonably expected to be
physically installed in real machines nowadays.
(I first thought we could just use pg_mul_s32_overflow during
printTableInit and raise an error if that returns true, but that just
postpones the problem.)
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Subversion to GIT: the shortest path to happiness I've ever heard of
(Alexey Klyukin)