Prev: Hot standby status
Next: per table random-page-cost?
From: Heikki Linnakangas on 20 Oct 2009 10:52 Tom Lane wrote: > Magnus Hagander <magnus(a)hagander.net> writes: >> 2009/10/20 Dave Page <dpage(a)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 -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Tom Lane on 20 Oct 2009 11:17 Heikki Linnakangas <heikki.linnakangas(a)enterprisedb.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. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Magnus Hagander on 20 Oct 2009 12:00 2009/10/20 Tom Lane <tgl(a)sss.pgh.pa.us>: > Heikki Linnakangas <heikki.linnakangas(a)enterprisedb.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/ -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: "Kevin Grittner" on 20 Oct 2009 12:07 Tom Lane <tgl(a)sss.pgh.pa.us> wrote: > if your software is written to depend on the appname being set a > particular way then you're not using for its intended purpose, I should think. Since any client can set this to whatever they want, having the application name as a default, rather than NULL (at least for clients on Windows, BSD, and Linux) would be a convenience for those using it for its intended purpose. -Kevin -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Tom Lane on 20 Oct 2009 12:16
Magnus Hagander <magnus(a)hagander.net> writes: > 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? Writing a pile of platform-specific code for this is simply insane from a support point of view. The feature is NOT worth it. Especially not since the typical result will be something quite uninformative like "psql" or "java". The cases that are actually useful are the ones where the application sets it. I don't think we should have a default at all --- you don't set it, you don't get a name. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |