Re: Application name patch - v2 - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Application name patch - v2
Date
Msg-id 4ADDCEB9.1080106@enterprisedb.com
Whole thread Raw
In response to Re: Application name patch - v2  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Application name patch - v2
List pgsql-hackers
Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
>> 2009/10/20 Dave Page <dpage@pgadmin.org>:
>>> Yeah, and there's a similar API on *BSD I believe, but nothing standard.
> 
>> Right, but it might be worth investigating using the API that's
>> available on the platform, if one is. It's a fairly simple operation
>> after all, so it won't take huge amounts of platform-specific code.
> 
> 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". And if you care enough,
you can override it in the application or with the environment variable.
Seems quite sane and harmless to me.

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Could postgres be much cleaner if a future release skipped backward compatibility?
Next
From: Tom Lane
Date:
Subject: Re: Could postgres be much cleaner if a future release skipped backward compatibility?