Re: Display individual query in pg_stat_activity - Mailing list pgsql-hackers

From Masahiro Ikeda
Subject Re: Display individual query in pg_stat_activity
Date
Msg-id 62bfb180c498c6b7b92387c713b30ba3@oss.nttdata.com
Whole thread Raw
In response to Re: Display individual query in pg_stat_activity  ("Drouvot, Bertrand" <bdrouvot@amazon.com>)
Responses Re: Display individual query in pg_stat_activity  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Hi,

> I've attached a patch to display individual query in the
> pg_stat_activity query field when multiple SQL statements are
> currently displayed.
> 
> Motivation:
> 
> When multiple statements are displayed then we don’t know which
> one is currently running.
> 
> I'm not sure I'd want that to happen, as it could make it much
> harder to track the activity back to a query in the application
> layer or server logs.
> 
> Perhaps a separate field could be added for the current statement,
> or a value to indicate what the current statement number in the
> query is?

As a user, I think this feature is useful to users.

It would be nice that pg_stat_activity also show currently running query
in a user defined function(PL/pgSQL) .

I understood that this patch is not for user defined functions.
Please let me know if it's better to make another thread.

In general, PL/pgSQL functions have multiple queries,
and users want to know the progress of query execution, doesn't it?

-- 
Masahiro Ikeda
NTT DATA CORPORATION



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [Patch] Optimize dropping of relation buffers using dlist
Next
From: Masahiro Ikeda
Date:
Subject: New statistics for tuning WAL buffer size