On Thu, Dec 19, 2019 at 12:14:26AM +0800, Kaijiang Chen wrote:
> Thanks!
> I learn the SQL from the web. pg views should be better.
> BTW, I got the similar result (still see that proc) with "select * from
> pg_stat_activity":
>
> backend_start | 2019-11-25 16:27:05.103901+08
> xact_start |
> query_start | 2019-11-25 16:29:29.529318+08
> state_change | 2019-11-25 16:29:29.529344+08
> waiting | f
> state | idle
> backend_xid |
> backend_xmin |
> query | DEALLOCATE pdo_stmt_00000388
>
> Looks not very nice :-)
not sure what you mean by not nice.
As you can clearly see the backend is *NOT* running anything (state is
idle).
Value in "query" column is simply last query that it ran. It *finished*
running this query at 2019-11-25 16:29:29.529344+08.
So your app is keeping connection open. It's not Pg problem or a bug.
Best regards,
depesz