Re: Application name patch - v2

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Dave Page <dpage(at)pgadmin(dot)org>, "Massa, Harald Armin" <chef(at)ghum(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Application name patch - v2
Date: 2009-10-20 16:00:59
Message-ID: 9837222c0910200900g49bdc165m40642cbd65243cbb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/10/20 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>> Tom Lane wrote:
>>> It would be a seriously bad idea for this to behave one way on some
>>> platforms and differently on others.
>
>> Why would that be so bad? On platforms that support getting argv[0],
>> you'd get "mycoolapp" in the application name by default. On others,
>> you'd get something like "unknown libpq app".
>
> Right, and if your software is written to depend on the appname being
> set a particular way, you suddenly find you have a portability problem.
> I don't think we should be in the business of creating hidden vendor
> lock-ins.

If your application depends on it being set properly, then have the
application set it. This would just be a *default*, you could still
override it - and should if it's really that important to your
application.

Also, how many platforms can't we do this on? If we have BSD and
Windows covered already. on linux, I believe you can easily read it
out of /proc/self/cmdline, no?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2009-10-20 16:02:01 Re: UTF8 with BOM support in psql
Previous Message Kevin Grittner 2009-10-20 15:54:49 Re: UTF8 with BOM support in psql