[prev in list] [next in list] [prev in thread] [next in thread]
List: postgresql-general
Subject: Re: What do you do with a long running rollback
From: Tom Lane <tgl () sss ! pgh ! pa ! us>
Date: 2021-11-26 19:44:29
Message-ID: 444716.1637955869 () sss ! pgh ! pa ! us
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic