invalid memory alloc request size from pg_stat_activity?

James Tomson <james@pushd.com>

From: James Tomson <james@pushd.com>
To: pgsql-bugs@lists.postgresql.org
Cc: Eric Jensen <ej@pushd.com>
Date: 2019-05-06T23:04:18Z
Lists: pgsql-bugs
Hello,

We're upgrading from postgresql 9.6 to 10.6 and everything is working fine, but any query against pg_stat_activity results in ERROR:  invalid memory alloc request size 1652113408

e.g:

ourdb=> SELECT pid, state, age(query_start, clock_timestamp()), usename, query FROM pg_stat_activity WHERE query != '<IDLE>' AND state != 'idle' ORDER BY age limit 100;
ERROR:  invalid memory alloc request size 1652113408

Maybe this has to do with us setting track_activity_query_size=102400? Is there a known safe maximum for that, or could there be some other problem?

Thanks,
James


Commits

  1. Avoid "invalid memory alloc request size" while reading pg_stat_activity.