Re: pg_stat_activity.application_name - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: pg_stat_activity.application_name
Date
Msg-id 4A5F3A510200002500028857@gw.wicourts.gov
Whole thread Raw
In response to Re: pg_stat_activity.application_name  (Jaime Casanova <jcasanov@systemguards.com.ec>)
Responses Re: pg_stat_activity.application_name
List pgsql-hackers
Jaime Casanova <jcasanov@systemguards.com.ec> wrote: 
> Kevin Grittner<Kevin.Grittner@wicourts.gov> wrote:
>> On the admin list there was a request for an application name
>> column in pg_stat_activity.
> ah? how do you implement that? and what's the use case for?
It would be passed as a connection property.  (If that's not feasible,
perhaps a session GUC, which could map to a client-side connection
property is JDBC, etc.)  For many environments, it is at least as
important as an IP address or PID to help someone managing a database
with a lot of connections.  It would not do anything on the server
except show up in pg_stat_activity as another piece of information
about each connection.
We would probably want to modify psql, pg_dump, etc. to put the
application name into this connection property, at least by default. 
We may want to add a command-line switch to allow user override -- to
provide something more detailed.  For example,
--application-name='Weekly Purge' could by specified on the psql
command line.
Yes, this is only as useful as the compliance of the client
applications make it.
-Kevin


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: COPY WITH CSV FORCE QUOTE *
Next
From: Greg Stark
Date:
Subject: Re: pg_stat_activity.application_name