From: Tom Lane <tgl@sss.pgh.pa.us>
To: depesz@depesz.com
Cc: Kaijiang Chen <chenkaijiang@gmail.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: Fwd: weird long time query
Date: Wed, 18 Dec 2019 11:30:43 -0500
Message-ID: <5855.1576686643@sss.pgh.pa.us> (raw)
In-Reply-To: <20191218162349.GA11569@depesz.com>
References: <CAAkGvS8ocfeVFOCsxoAY6suzMkrW+O9twRAQ2c4WrZNbQ=vSpg@mail.gmail.com>
<CAAkGvS_FSZf=uzTwWbTnRe7hXruga_opSeCPDueNR09v9Ow47Q@mail.gmail.com>
<20191218140631.GA1083@depesz.com>
<CAAkGvS9Us7C1r6eSPEz-NbazySX-GGOBtwAjczhFzg_hR9CsMA@mail.gmail.com>
<20191218162349.GA11569@depesz.com>
hubert depesz lubaczewski <depesz@depesz.com> writes:
> On Thu, Dec 19, 2019 at 12:14:26AM +0800, Kaijiang Chen wrote:
>> BTW, I got the similar result (still see that proc) with "select * from
>> pg_stat_activity":
>> ...
>> state | idle
>> ...
>> query | DEALLOCATE pdo_stmt_00000388
>>
>> Looks not very nice :-)
> not sure what you mean by not nice.
That's a feature not a bug (and yes, the behavior is documented).
People requested that the view continue to display the last query
of an idle session. IIRC, the main argument was that otherwise
it's hard to tell apart a bunch of idle sessions.
If you don't like it, you can always do something like
case when state = idle then null else query end
regards, tom lane
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: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, depesz@depesz.com, chenkaijiang@gmail.com, pgsql-bugs@postgresql.org
Subject: Re: Fwd: weird long time query
In-Reply-To: <5855.1576686643@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox