Fwd: weird long time query

From: Kaijiang Chen <chenkaijiang(at)gmail(dot)com>
To: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Fwd: weird long time query
Date: 2019-12-18 03:25:32
Message-ID: CAAkGvS_FSZf=uzTwWbTnRe7hXruga_opSeCPDueNR09v9Ow47Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general pgsql-performance

I'm using postgres 9.4.17 on centos 7.
I check the running queries with the following SQL:
SELECT
procpid,
start,
now() - start AS lap,
current_query
FROM
(SELECT
backendid,
pg_stat_get_backend_pid(S.backendid) AS procpid,
pg_stat_get_backend_activity_start(S.backendid) AS start,
pg_stat_get_backend_activity(S.backendid) AS current_query
FROM
(SELECT pg_stat_get_backend_idset() AS backendid) AS S
) AS S
WHERE
current_query <> '<IDLE>'
ORDER BY
lap DESC;

Then, I found a SQL that has run for some days (and still running):
procpid | 32638
start | 2019-11-25 16:29:29.529318+08
lap | 21 days 18:24:54.707369
current_query | DEALLOCATE pdo_stmt_00000388

I tried to kill it with: SELECT pg_cancel_backend(32638) but it takes no
effects.

What's this query and what shall I do for it?

I think it is a bug since logically, this query should be gone.

Best Wishes
Kaijiang

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2019-12-18 06:00:00 Re: BUG #16161: pg_ctl stop fails sometimes (on Windows)
Previous Message Kyotaro Horiguchi 2019-12-18 03:25:26 Re: BUG #16161: pg_ctl stop fails sometimes (on Windows)

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2019-12-18 09:37:35 Re: Encoding/collation question
Previous Message Kaijiang Chen 2019-12-18 03:23:37 Re: weird long time query

Browse pgsql-performance by date

  From Date Subject
Next Message Justin Pryzby 2019-12-18 04:01:19 Re: shared memory size during upgrade pgsql with partitions (max_locks_per_transaction)
Previous Message Kaijiang Chen 2019-12-18 03:23:37 Re: weird long time query