Re: What do you do with a long running rollback - Mailing list pgsql-general

From Tom Lane
Subject Re: What do you do with a long running rollback
Date
Msg-id 444716.1637955869@sss.pgh.pa.us
Whole thread Raw
List pgsql-general
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



pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: Merge into does not work
Next
From: Alvaro Herrera
Date:
Subject: Re: Merge into does not work