Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnSes-0001Ju-E3 for pgsql-jdbc@arkaria.postgresql.org; Thu, 31 Aug 2017 16:49:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dnSes-0008Ps-0l for pgsql-jdbc@arkaria.postgresql.org; Thu, 31 Aug 2017 16:49:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dnSeN-0007XH-4p for pgsql-jdbc@postgresql.org; Thu, 31 Aug 2017 16:49:03 +0000 Received: from mail-qt0-x22c.google.com ([2607:f8b0:400d:c0d::22c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dnSeK-0003DA-O3 for pgsql-jdbc@postgresql.org; Thu, 31 Aug 2017 16:49:01 +0000 Received: by mail-qt0-x22c.google.com with SMTP id e2so954024qta.0 for ; Thu, 31 Aug 2017 09:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ecR/lso1qDPTqEwiky6wvX5qA2COd6SDftRhHOoJuBc=; b=mCjoPVf6Buy/xtjaRhdXcq40wSFQbOgzPMn4HWPUWJZJr6ezOie7vI1vOPTLhdSHHJ Iiaro5JyR2wdFLK59+Hm6wgrTuG2HDbj7hlMfevnS5qnJFk+V92MbRerFXxTCCR29c7b ciPat/z249x7Cw9VLgu2tr7r2jtLt2EJNKmBvwgBEOAt8/uTnWWcbfFqE/jIcbKdeTJ/ VEGOLaCxdlfAqD4V/tKMj1EfdTdrSDLc00J7ULzyWkL15GBS/DNzbIVxIL8lwYJAA81V W7S1Mj9JdycgB4IlBXtH/H2tkMfGvOE/GowVTzLoHZmpgRrwW8yuAPTM+0qOkvU+acHw 9bbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ecR/lso1qDPTqEwiky6wvX5qA2COd6SDftRhHOoJuBc=; b=uI9TiAKhBtckgw7y6TiUh7fDPG9ZtXx7vtW2rx8D9oiN0ECVfcjvfG7bAR4DiHZI6Y gIXIouV/e5RIJCo9ssZYyVtMLRpZB0wL5cbNYj3QoHuNYMDwXJhjKCRoEbiuGi3WZ/ZM AbTVLFwyM/bwv20MLNjVVJ+lGybZJ2bincH628Gg8KLGl7I0q0AycF27zMFrLqMD/GlC dBrZQhqRXA+TCDHJxFS0ujD8L88pngDmstZ8DGawtFXfV6X6zJ+1K5KjjbeE6NMImGUY D6VU5FXf4pAQdOyqOYHbeXR/5RULCDePVKsFXs8rc6KfcHlQqg/iQ+qrJqAc2LiXnstU ufAQ== X-Gm-Message-State: AHYfb5gcizBRoZ/LMleagFiBPZd3LyvlrHO/42hcK+kQupqjpAJ+h7aK mR0PqELz7t7X/yp404izNjIEZ627en2w X-Google-Smtp-Source: ADKCNb49sEdEk1GaLanfEtH1Wy2i9LxtTH3dwaxfHkvDnS7XCL8W8QrQO4oP16KApiZxYp5faiUdBzgUtk11UzuZAJY= X-Received: by 10.200.9.125 with SMTP id z58mr8748956qth.280.1504198139549; Thu, 31 Aug 2017 09:48:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.193.209 with HTTP; Thu, 31 Aug 2017 09:48:58 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Thu, 31 Aug 2017 09:48:58 -0700 Message-ID: Subject: Re: Statement is still active at the back-end even after closing To: Syam Pillai Cc: List Content-Type: multipart/alternative; boundary="001a1147cbfec79c8d05580f6bce" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org --001a1147cbfec79c8d05580f6bce Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Aug 31, 2017 at 1:50 AM, Syam Pillai wrote: > =E2=80=8B > Query executed to check the activity: > SELECT pid, datname, now() - pg_stat_activity.query_start AS duration, > state, query > FROM pg_stat_activity > WHERE now() - pg_stat_activity.query_start > interval '1 second'; > Output from psql: > pid | datname | duration | state | query > -------+---------+-----------------+-------+--------------------------- > 17775 | xxxx | 00:00:07.481294 | idle | SELECT 1 FROM core.Person > > =E2=80=8Bstate =3D "idle" which means that they query column is showing the= last executed query - not something that is presently running. David J. =E2=80=8B --001a1147cbfec79c8d05580f6bce Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Au= g 31, 2017 at 1:50 AM, Syam Pillai <syam@engravgroup.com> wrote:
=E2= =80=8B
Query executed to check the activity:
SELECT pid,= datname, now() - pg_stat_activity.query_start AS duration, state, query
FROM pg_stat_activity
WHERE now() - pg_stat_activity.quer= y_start > interval '1 second';
Output from psql:
=
=C2=A0 pid =C2=A0| datname | =C2=A0 =C2=A0duration =C2=A0 =C2=A0 = | state | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 query =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0=C2=A0
-------+---------+-----------------+-------= +---------------------------
=C2=A017775 | xxxx =C2=A0 | 00:= 00:07.481294 | idle =C2=A0| SELECT 1 FROM core.Person

<= /div>

=E2=80=8Bstate = =3D "idle" which means that they query column is showing the last= executed query - not something that is presently running.

David J.
=E2=80=8B

--001a1147cbfec79c8d05580f6bce--