Re: Client application name

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Client application name
Date: 2009-10-15 15:25:32
Message-ID: 937d27e10910150825h27e84a7ds5cb8d31664ed719d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 15, 2009 at 3:50 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Dave Page <dpage(at)pgadmin(dot)org> writes:
>> On Thu, Oct 15, 2009 at 3:28 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> Also, I am wondering exactly what you think psql would *do* with the
>>> parameter if it had it.  If the answer is "force the setting to be
>>> 'psql'", that's the wrong answer.  IMO you'd really want the environment
>>> variable to take precedence over that, if set.  But libpq considers the
>>> priority to go the other way.
>
>> Well in the psql case, it could flip that priority itself and only set
>> the value if the environment variable wasn't set - which I agree would
>> seem the right thing to do. On further thought, it would seem
>> reasonable to do the same in the other apps as well, so you could have
>> your backup script do something like "PGAPPLICATIONNAME="Nightly
>> backup" /usr/bin/pg_dump ..."
>
> Hmm.  Maybe this is a generic problem.  Should libpq offer some sort
> of help?  Maybe a "secondaryappname" parameter that doesn't override
> the env variable.

is it worth uglifying libpq? All we're talking about is something like:

if (!getenv("PGAPPLICATIONNAME"))
strncat(connstr, " application_name=psql", sizeof(connstr) -
strlen(connstr) - 1);

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-10-15 15:34:51 Re: EXPLAIN BUFFERS
Previous Message Tom Lane 2009-10-15 15:06:23 Re: EXPLAIN BUFFERS