public inbox for [email protected]
help / color / mirror / Atom feedFrom: Peter Eisentraut <[email protected]>
To: Michael Paquier <[email protected]>
To: Jakub Wartak <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Robert Haas <[email protected]>
Subject: Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()
Date: Wed, 27 Sep 2023 15:42:15 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAKZiRmw8QSNVw2qNK-dznsatQqz+9DkCquxP0GHbbv1jMkGHMA@mail.gmail.com>
<[email protected]>
On 27.09.23 09:08, Michael Paquier wrote:
> On Wed, Sep 27, 2023 at 08:41:55AM +0200, Jakub Wartak wrote:
>> Attached patch adjusts pgstat_track_activity_query_size to be of
>> size_t from int and fixes the issue.
>
> This cannot be backpatched, and using size_t is not really needed as
> track_activity_query_size is capped at 1MB. Why don't you just tweak
> the calculation done in pgstat_read_current_status() instead, say with
> a cast?
I think it's preferable to use the right type to begin with, rather than
fixing it up afterwards with casts.
view thread (5+ messages) latest in thread
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox