Re: [HACKERS] Application name patch - v2

2009-10-21 Thread Kevin Grittner
Dave Page wrote: > Robert Haas wrote: > >> I also like PGAPPNAME better, for the same reasons as Tom. > > :-). Have to admit, I've mistyped it a few times too. Well, it would seem we have consensus on that. :-) I don't feel that the Java default issue reached the same level of consensus, t

Re: [HACKERS] Application name patch - v2

2009-10-21 Thread Dave Page
On Wed, Oct 21, 2009 at 4:29 PM, Robert Haas wrote: > I also like PGAPPNAME better, for the same reasons as Tom. :-). Have to admit, I've mistyped it a few times too. -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com PGDay.EU 2009 Conference: http://2009.pgday.eu/start -- Sent via p

Re: [HACKERS] Application name patch - v2

2009-10-21 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan writes: Tom Lane wrote: FWIW, I would prefer PGAPPNAME to PGAPPLICATIONNAME which is what We don't usually use abbreviations, so how about PGCLIENTNAME or some such? Not sure I believe that argument. Among the set of existing libpq

Re: [HACKERS] Application name patch - v2

2009-10-21 Thread Robert Haas
On Wed, Oct 21, 2009 at 11:25 AM, Tom Lane wrote: > Andrew Dunstan writes: >> Tom Lane wrote: >>> FWIW, I would prefer PGAPPNAME to PGAPPLICATIONNAME which is what > >> We don't usually use abbreviations, so how about PGCLIENTNAME  or some such? > > Not sure I believe that argument.  Among the se

Re: [HACKERS] Application name patch - v2

2009-10-21 Thread Tom Lane
Andrew Dunstan writes: > Tom Lane wrote: >> FWIW, I would prefer PGAPPNAME to PGAPPLICATIONNAME which is what > We don't usually use abbreviations, so how about PGCLIENTNAME or some such? Not sure I believe that argument. Among the set of existing libpq environment variables I see PGHOSTADDR

Re: [HACKERS] Application name patch - v2

2009-10-21 Thread Andrew Dunstan
Tom Lane wrote: "Kevin Grittner" writes: (or whatever name we choose for this in place of PGAPPNAME.) FWIW, I would prefer PGAPPNAME to PGAPPLICATIONNAME which is what Dave has been using in his examples. The latter is too frickin long, and the double N is a typo threat (I already

Re: [HACKERS] Application name patch - v2

2009-10-21 Thread Tom Lane
"Kevin Grittner" writes: > (or whatever name we choose for this in place of PGAPPNAME.) FWIW, I would prefer PGAPPNAME to PGAPPLICATIONNAME which is what Dave has been using in his examples. The latter is too frickin long, and the double N is a typo threat (I already mistyped it in composing thi

Re: [HACKERS] Application name patch - v2

2009-10-21 Thread Kevin Grittner
Tom Lane wrote: > [ scratches head... ] I thought the JDBC spec already said exactly > how one would set this. Why would we go to significant effort to > make it behave contrary to spec? We certainly should allow it to be set as specified in the spec. The only question is whether it makes s

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Tom Lane
"Kevin Grittner" writes: > Magnus Hagander 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 s

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Kevin Grittner
Magnus Hagander 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

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Tom Lane
daveg 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 repo

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread daveg
On Tue, Oct 20, 2009 at 12:16:42PM -0400, Tom Lane wrote: > Magnus Hagander 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-specif

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Dimitri Fontaine
Magnus Hagander writes: > 2009/10/20 Tom Lane : >> "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.sq

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Magnus Hagander
2009/10/20 Tom Lane : > Magnus Hagander 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 >

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Tom Lane
Magnus Hagander 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 f

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Kevin Grittner
Tom Lane 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 cli

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Magnus Hagander
2009/10/20 Tom Lane : > Heikki Linnakangas 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 applicati

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Tom Lane
Heikki Linnakangas 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,

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Heikki Linnakangas
Tom Lane wrote: > Magnus Hagander writes: >> 2009/10/20 Dave Page : >>> 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 al

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Tom Lane
Magnus Hagander writes: > 2009/10/20 Dave Page : >> 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

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Magnus Hagander
2009/10/20 Dave Page : > On Mon, Oct 19, 2009 at 9:34 PM, Magnus Hagander wrote: >> 2009/10/19 Dave Page : >>> On Mon, Oct 19, 2009 at 3:42 PM, Massa, Harald Armin wrote: Would'nt this also make sense for PostgreSQL? That is, when no environment is set, and no SET-command is issued

Re: [HACKERS] Application name patch - v2

2009-10-20 Thread Dave Page
On Mon, Oct 19, 2009 at 9:34 PM, Magnus Hagander wrote: > 2009/10/19 Dave Page : >> On Mon, Oct 19, 2009 at 3:42 PM, Massa, Harald Armin wrote: >>> >>> Would'nt this also make sense for PostgreSQL? That is, when no environment >>> is set, and no SET-command is issued, that the application name be

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Magnus Hagander
2009/10/20 Bruce Momjian : > Robert Haas wrote: >> > I do agree with Peter's concerns about limiting the character set of the >> > name string, and maybe there should be some sort of length limit too. >> >> I don't have a strong feeling about this.  If limiting this to 7-bit >> characters solves so

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Bruce Momjian
Robert Haas wrote: > > I do agree with Peter's concerns about limiting the character set of the > > name string, and maybe there should be some sort of length limit too. > > I don't have a strong feeling about this. If limiting this to 7-bit > characters solves some nasty encoding problems or som

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Magnus Hagander
2009/10/19 Dave Page : > On Mon, Oct 19, 2009 at 3:42 PM, Massa, Harald Armin wrote: >> >> Would'nt this also make sense for PostgreSQL? That is, when no environment >> is set, and no SET-command is issued, that the application name becomes the >> default? > > That needs to be set by the applicati

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Stephen Frost : > * Pavel Stehule (pavel.steh...@gmail.com) wrote: >> 2009/10/19 Stephen Frost : >> > * Pavel Stehule (pavel.steh...@gmail.com) wrote: >> >> Superuser permission could not be a problem. Simple security definer >> >> function can do it. >> > >> > Then you've defeated the p

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Kevin Grittner
Robert Haas wrote: > Tom Lane wrote: >> I think Pavel's entire line of argument is utter nonsense. > +1. I can't even understand why we're still arguing about this. Agreed. One premise of the whole concept was "don't even think of using it for security"[1]. That's not it's purpose; so an

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Kevin Grittner
David Fetter wrote: > Could you point to a reference for this? It could help the rest of us > see what you're aiming for even better :) Sybase Adaptive Server Enterprise (ASE) clientapplname varchar(30) column in sysprocesses table: http://infocenter.sybase.com/help/index.jsp?topic=/com.

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Robert Haas
On Mon, Oct 19, 2009 at 10:36 AM, Tom Lane wrote: > Dave Page writes: >> On Mon, Oct 19, 2009 at 12:57 PM, Pavel Stehule >> wrote: >>> I thing, so change of original name should generate warning. > >> Well, if other people think that's necessary, it's certainly possible. > > I think Pavel's ent

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Stephen Frost
* Pavel Stehule (pavel.steh...@gmail.com) wrote: > 2009/10/19 Stephen Frost : > > * Pavel Stehule (pavel.steh...@gmail.com) wrote: > >> Superuser permission could not be a problem. Simple security definer > >> function can do it. > > > > Then you've defeated the point of making it superuser-only. >

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Stephen Frost : > * Pavel Stehule (pavel.steh...@gmail.com) wrote: >> Superuser permission could not be a problem. Simple security definer >> function can do it. > > Then you've defeated the point of making it superuser-only. no. Because when I write security definer function, then I ex

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 3:49 PM, Tom Lane wrote: > Stephen Frost writes: >> * Tom Lane (t...@sss.pgh.pa.us) wrote: >>> I do agree with Peter's concerns about limiting the character set of the >>> name string, and maybe there should be some sort of length limit too. > >> I was thinking we might ju

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> I do agree with Peter's concerns about limiting the character set of the >> name string, and maybe there should be some sort of length limit too. > I was thinking we might just declare it of type 'name'.. 'name' wouldn't help, sin

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 3:42 PM, Massa, Harald Armin wrote: > > Would'nt this also make sense for PostgreSQL? That is, when no environment > is set, and no SET-command is issued, that the application name becomes the > default? That needs to be set by the application. As discussed previously, the

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Massa, Harald Armin
> Sure. Here's a nice example from SQL Server as well as related doc links: > > http://blog.benhall.me.uk/2007/10/sql-connection-application-name.html > http://msdn.microsoft.com/en-us/library/ms189770.aspx > > http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionst

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > Dave Page writes: > > Well, if other people think that's necessary, it's certainly possible. > > I think Pavel's entire line of argument is utter nonsense. He's setting > up a straw man that has nothing to do with any actually likely use of > the variable

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Tom Lane
David Fetter writes: > On Mon, Oct 19, 2009 at 11:39:58AM +0100, Dave Page wrote: >> Please bear in mind that this feature is based on similar features in >> other DBMSs (and in fact, a feature in the JDBC spec) > Could you point to a reference for this? It could help the rest of us > see what y

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 3:17 PM, David Fetter wrote: > Could you point to a reference for this?  It could help the rest of us > see what you're aiming for even better :) Sure. Here's a nice example from SQL Server as well as related doc links: http://blog.benhall.me.uk/2007/10/sql-connection-ap

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Stephen Frost
* Pavel Stehule (pavel.steh...@gmail.com) wrote: > 2009/10/19 Heikki Linnakangas : > > Or are you saying that it should not be possible for the client to > > change the value after connecting? That limits the usefulness with > > connection pools. > > What I know, connections from connection pool w

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Tom Lane
Dave Page writes: > On Mon, Oct 19, 2009 at 12:57 PM, Pavel Stehule > wrote: >> I thing, so change of original name should generate warning. > Well, if other people think that's necessary, it's certainly possible. I think Pavel's entire line of argument is utter nonsense. He's setting up a st

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Stephen Frost
* Pavel Stehule (pavel.steh...@gmail.com) wrote: > Superuser permission could not be a problem. Simple security definer > function can do it. Then you've defeated the point of making it superuser-only. I don't think that changing the app name deserves a warning, to be perfectly honest. Notice sh

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread David Fetter
On Mon, Oct 19, 2009 at 11:39:58AM +0100, Dave Page wrote: > Excuse me one moment whilst I pick myself up from the floor :-) Heh! > Can you imagine what a maintenance nightmare that would soon become? Only vaguely, and that's enough. > Please bear in mind that this feature is based on similar f

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
> >  -- monthly_report monthly_process.py:524 >  select wev from foo; > > This feature would be very handy, but not if it requires special permission > to use it. Superuser permission could not be a problem. Simple security definer function can do it. Regards Pavel > > -dg > > > -- > David Goul

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Dimitri Fontaine : > Andrew Dunstan writes: >> Pavel Stehule wrote: >>> Others GUC has not important role in logs. It's similar as possibility >>> to change client IP address. >> >> That doesn't even remotely answer the question. How is such a thing a vector >> for an SQL injection atta

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dimitri Fontaine
Andrew Dunstan writes: > Pavel Stehule wrote: >> Others GUC has not important role in logs. It's similar as possibility >> to change client IP address. > > That doesn't even remotely answer the question. How is such a thing a vector > for an SQL injection attack, that does not apply to other GUCs?

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread daveg
On Mon, Oct 19, 2009 at 01:00:28PM +0100, Dave Page wrote: > On Mon, Oct 19, 2009 at 12:57 PM, Pavel Stehule > wrote: > > It is not practical. I'll log errors. Usually SQL injection generates > > lot of errors. Loging all statements has not sense. What is difference > > bad and good SQL statement

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 12:57 PM, Pavel Stehule wrote: > It is not practical. I'll log errors. Usually SQL injection generates > lot of errors. Loging all statements has not sense. What is difference > bad and good SQL statement.? Maybe multistatements are good candidates > for log as possible att

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Dave Page : > On Mon, Oct 19, 2009 at 12:33 PM, Pavel Stehule > wrote: >> 2009/10/19 Dave Page : >>> On Mon, Oct 19, 2009 at 10:45 AM, Pavel Stehule >>> wrote: >>> sure, you have to fix fulnerable application. But with some unsophisticated using %a and using wrong tools, th

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 12:33 PM, Pavel Stehule wrote: > 2009/10/19 Dave Page : >> On Mon, Oct 19, 2009 at 10:45 AM, Pavel Stehule >> wrote: >> >>> sure, you have to fix fulnerable application. But with some >>> unsophisticated using %a and using wrong tools, the people can be >>> blind and don'

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Pavel Stehule : > 2009/10/19 Dave Page : >> On Mon, Oct 19, 2009 at 10:45 AM, Pavel Stehule >> wrote: >> >>> sure, you have to fix fulnerable application. But with some >>> unsophisticated using %a and using wrong tools, the people can be >>> blind and don't register an SQL injection a

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Dave Page : > On Mon, Oct 19, 2009 at 10:45 AM, Pavel Stehule > wrote: > >> sure, you have to fix fulnerable application. But with some >> unsophisticated using %a and using wrong tools, the people can be >> blind and don't register an SQL injection attack. > > If they're logging the s

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 11:21 AM, Peter Eisentraut wrote: >> A user can do that anyway if query logging is turned on, but anyway, >> what would you suggest - accept a-zA-Z0-9 and a few other choice >> characters only, or just reject a handful (and if so, what)? > > Well, either you make the thing

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Peter Eisentraut
On Mon, 2009-10-19 at 08:47 +0100, Dave Page wrote: > On Mon, Oct 19, 2009 at 8:37 AM, Peter Eisentraut wrote: > > On Fri, 2009-10-16 at 12:58 +0100, Dave Page wrote: > >> I think that covers all the suggestions discussed over the last couple > >> of days, with the exception of the rejection of \n

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
Updated patch attached, fixing a silly thinko. On Fri, Oct 16, 2009 at 12:58 PM, Dave Page wrote: > I believe the attached patch is ready for review at the next > commitfest. It does the following: > > - Adds a userset GUC called application_name. > - Allows application_name to be reported in log

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 10:45 AM, Pavel Stehule wrote: > sure, you have to fix fulnerable application. But with some > unsophisticated using %a and using wrong tools, the people can be > blind and don't register an SQL injection attack. If they're logging the statements (which they presumably ar

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Dave Page : > On Mon, Oct 19, 2009 at 10:22 AM, Pavel Stehule > wrote: >> 2009/10/19 Dave Page : >>> On Mon, Oct 19, 2009 at 10:01 AM, Pavel Stehule >>> wrote: >>> There are some log parser's and analysers. So people use reduced log often. The reductions rules should be bas

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 10:22 AM, Pavel Stehule wrote: > 2009/10/19 Dave Page : >> On Mon, Oct 19, 2009 at 10:01 AM, Pavel Stehule >> wrote: >> >>> There are some log parser's and analysers. So people use reduced log >>> often. The reductions rules should be based on application name. Why >>> no

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Andrew Dunstan : > > > Pavel Stehule wrote: >> >> 2009/10/19 Andrew Dunstan : >> >>> >>> Pavel Stehule wrote: >>> 2009/10/19 Dave Page : > > On Mon, Oct 19, 2009 at 8:54 AM, Pavel Stehule > > wrote: > > >> >> I dislike write access to

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Dave Page : > On Mon, Oct 19, 2009 at 10:01 AM, Pavel Stehule > wrote: > >> There are some log parser's and analysers. So people use reduced log >> often. The reductions rules should be based on application name. Why >> not? And when somebody modifies to appliacation name, then these l

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Andrew Dunstan
Pavel Stehule wrote: 2009/10/19 Andrew Dunstan : Pavel Stehule wrote: 2009/10/19 Dave Page : On Mon, Oct 19, 2009 at 8:54 AM, Pavel Stehule wrote: I dislike write access to app name guc for user too. It's not safe. Maybe only super user can do it? Tha

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 10:01 AM, Pavel Stehule wrote: > There are some log parser's and analysers. So people use reduced log > often. The reductions rules should be based on application name. Why > not? And when somebody modifies to appliacation name, then these logs > finish in '/dev/null. So

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Dave Page : > On Mon, Oct 19, 2009 at 9:36 AM, Pavel Stehule > wrote: >> Then we have to divide this value to two independent values like >> application_name and application_state. > > How does that make any difference? That just means we have two values, > at least one of which is sti

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Andrew Dunstan : > > > Pavel Stehule wrote: >> >> 2009/10/19 Dave Page : >> >>> >>> On Mon, Oct 19, 2009 at 8:54 AM, Pavel Stehule >>> wrote: >>> I dislike write access to app name guc for user too. It's not safe. Maybe only super user can do it? >>> >>> That'll rend

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 9:36 AM, Pavel Stehule wrote: > Then we have to divide this value to two independent values like > application_name and application_state. How does that make any difference? That just means we have two values, at least one of which is still userset, and means an additional

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Andrew Dunstan
Pavel Stehule wrote: 2009/10/19 Dave Page : On Mon, Oct 19, 2009 at 8:54 AM, Pavel Stehule wrote: I dislike write access to app name guc for user too. It's not safe. Maybe only super user can do it? That'll render it pretty useless, as most applications wouldn't then be able

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Dave Page : > On Mon, Oct 19, 2009 at 9:23 AM, Pavel Stehule > wrote: >> 2009/10/19 Dave Page : >>> On Mon, Oct 19, 2009 at 8:54 AM, Pavel Stehule >>> wrote: I dislike write access to app name guc for user too. It's not safe. Maybe only super user can do it? >>> >>> That'll

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 9:23 AM, Pavel Stehule wrote: > 2009/10/19 Dave Page : >> On Mon, Oct 19, 2009 at 8:54 AM, Pavel Stehule >> wrote: >>> I dislike write access to app name guc for user too. It's not safe. >>> Maybe only super user can do it? >> >> That'll render it pretty useless, as most

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Heikki Linnakangas : > Pavel Stehule wrote: >> 2009/10/19 Dave Page : >>> On Mon, Oct 19, 2009 at 8:37 AM, Peter Eisentraut wrote: So this would effectively allow any minimally authorized user to write whatever they want into the log file whenever they want?  Doesn't sound >>>

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Dave Page : > On Mon, Oct 19, 2009 at 8:54 AM, Pavel Stehule > wrote: >> I dislike write access to app name guc for user too. It's not safe. >> Maybe only super user can do it? > > That'll render it pretty useless, as most applications wouldn't then > be able to set/reset it when it ma

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Heikki Linnakangas
Pavel Stehule wrote: > 2009/10/19 Dave Page : >> On Mon, Oct 19, 2009 at 8:37 AM, Peter Eisentraut wrote: >>> So this would effectively allow any minimally authorized user to write >>> whatever they want into the log file whenever they want? Doesn't sound >>> very safe to me. >> A user can do tha

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 8:54 AM, Pavel Stehule wrote: > I dislike write access to app name guc for user too. It's not safe. > Maybe only super user can do it? That'll render it pretty useless, as most applications wouldn't then be able to set/reset it when it makes sense to do so. -- Dave Page

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Pavel Stehule
2009/10/19 Dave Page : > On Mon, Oct 19, 2009 at 8:37 AM, Peter Eisentraut wrote: >> On Fri, 2009-10-16 at 12:58 +0100, Dave Page wrote: >>> I think that covers all the suggestions discussed over the last couple >>> of days, with the exception of the rejection of \n and similar >>> characters whic

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Dave Page
On Mon, Oct 19, 2009 at 8:37 AM, Peter Eisentraut wrote: > On Fri, 2009-10-16 at 12:58 +0100, Dave Page wrote: >> I think that covers all the suggestions discussed over the last couple >> of days, with the exception of the rejection of \n and similar >> characters which I'm still not entirely conv

Re: [HACKERS] Application name patch - v2

2009-10-19 Thread Peter Eisentraut
On Fri, 2009-10-16 at 12:58 +0100, Dave Page wrote: > I think that covers all the suggestions discussed over the last couple > of days, with the exception of the rejection of \n and similar > characters which I'm still not entirely convinced is worth the effort. > Any other opinions on that? Anythi

[HACKERS] Application name patch - v2

2009-10-16 Thread Dave Page
I believe the attached patch is ready for review at the next commitfest. It does the following: - Adds a userset GUC called application_name. - Allows application_name to be reported in log_line_prefix using %a. - Includes application_name in CSV logs. - Displays application_name in the output of