pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chris Cawley <cj_cawley@yahoo.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: What do you do with a long running rollback
Date: Fri, 26 Nov 2021 14:44:29 -0500
Message-ID: <444716.1637955869@sss.pgh.pa.us> (raw)
In-Reply-To: <110423391.2770447.1637952642367@mail.yahoo.com>
References: <1977259621.1023368.1637951601701.ref@mail.yahoo.com>
	<1977259621.1023368.1637951601701@mail.yahoo.com>
	<440098.1637952136@sss.pgh.pa.us>
	<110423391.2770447.1637952642367@mail.yahoo.com>

Chris Cawley <cj_cawley@yahoo.com> writes:
> Here's the query :

> | SELECT pid, age(clock_timestamp(), query_start), usename, query  |
> |  | FROM pg_stat_activity  |
> |  | WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'  |
> |  | ORDER BY query_start desc; |

> Return output is pid | 4 days | user | ROLLBACK

I think the fault's in your query; it's presuming a long-obsolete
convention about how idle sessions are represented in pg_stat_activity.
These days you should be filtering on "state" or "wait_event_type".
This output is just telling you that the last thing that session
did, four days ago, was a ROLLBACK.

			regards, tom lane





view thread (3+ messages)

Message-ID: <444716.1637955869@sss.pgh.pa.us>
Permalink:  ../444716.1637955869@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/444716.1637955869@sss.pgh.pa.us

 · 

reply

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, cj_cawley@yahoo.com, pgsql-general@lists.postgresql.org
  Subject: Re: What do you do with a long running rollback
  In-Reply-To: <444716.1637955869@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