Re: pg_stat_activity.application_name

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jaime Casanova" <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_activity.application_name
Date: 2009-07-16 19:33:53
Message-ID: 4A5F3A510200002500028857@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec> wrote:
> Kevin Grittner<Kevin(dot)Grittner(at)wicourts(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2009-07-16 19:37:42 Re: pg_stat_activity.application_name
Previous Message Andrew Dunstan 2009-07-16 19:26:26 Re: COPY WITH CSV FORCE QUOTE *