Prev: Hot standby status
Next: per table random-page-cost?
From: Magnus Hagander on 20 Oct 2009 12:18 2009/10/20 Tom Lane <tgl(a)sss.pgh.pa.us>: > 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. For psql, yes. For java, it doesn't even go through libpq, so it wouldn't be set for it. And I'd expect the JDBC driver to set it based on Something Reasonable (TM) that it can get the information about. After all, this thing was listed in the JDBC spec somebody said... -- 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: Dimitri Fontaine on 20 Oct 2009 16:33 Magnus Hagander <magnus(a)hagander.net> writes: > 2009/10/20 Tom Lane <tgl(a)sss.pgh.pa.us>: >> "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. > > For psql, yes. What about having psql -f foo.sql using 'psql: foo.sql' or sth as the default value? -- dim -- 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: daveg on 20 Oct 2009 17:47 On Tue, Oct 20, 2009 at 12:16:42PM -0400, Tom Lane wrote: > 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. -1 I'd like a default, especially for psql, to help identify interactive sessions. -dg -- David Gould daveg(a)sonic.net 510 536 1443 510 282 0869 If simplicity worked, the world would be overrun with insects. -- 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 17:54 daveg <daveg(a)sonic.net> writes: > I'd like a default, especially for psql, to help identify interactive sessions. psql can certainly provide a default, and maybe even do something actually useful like report the -f file it's running. The question here is whether it is worth the trouble for libpq to try to report an appname *without* the surrounding application's cooperation. I don't think so. You are talking dozens if not hundreds of lines of unportable code, versus one line (per app) of entirely portable code. 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: "Kevin Grittner" on 20 Oct 2009 18:09
Magnus Hagander <magnus(a)hagander.net> wrote: > For java, it doesn't even go through libpq, so it wouldn't be set > for it. And I'd expect the JDBC driver to set it based on Something > Reasonable (TM) that it can get the information about. After all, > this thing was listed in the JDBC spec somebody said... I can't see a good way to get a meaningful default from within the bowels of the JDBC driver, unless it's taking a system property or environment variable. First off, generating a stack trace to try to pick up a class name would be too expensive to be something you'd want to do by default when opening a connection. For another, many applications are started from a bootstrap class (for good reason), so you can't just take the initial class name for a meaningful default. If you were running a GUI application you might try to find the title of some window frame, but that's pretty ugly. In short, I'd suggest supporting a system property for a default name. (For those unfamiliar with Java, a system property is very much like an environment variable, but just for the one Java Virtual Machine.) That seems more sane than an environment variable for the Java world. I don't see much other reasonable alternative, except of course that you should be able to override it when setting up any individual connection. -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 |