On Fri, Feb 28, 2025 at 6:50 AM KK CHN wrote:
> List
>
> postgres=# SELECT PID, now() - pg_stat_activity.query_start AS duration,
> query, state FROM pg_stat_activity WHERE (now() - pg
> _stat_activity.query_start) > interval '5 minutes' AND state = 'active';
> pid |duration |
That's harmless, it is the walsender process, and it is meant to be
long-running. You can modify your query and add this:
AND backend_type = 'client backend'
to filter out any background processes.
Cheers,
Greg
--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products
List
postgres=# SELECT PID, now() - pg_stat_activity.query_start AS duration,
query, state FROM pg_stat_activity WHERE (now() - pg
_stat_activity.query_start) > interval '5 minutes' AND state = 'active';
pid |duration | query
| state
--+--