Achilleas Mantzios wrote:
> Î£Ï„Î¹Ï‚ Tuesday 22 July 2008 15:17:42 Î¿/Î· Rajesh Kumar Mallah
>> We want to log all SQLs that has been executed by using psql
>> client. we do not want to use .psql_history as it is distributed
>> and may be deleted by users .
>> The original objective is that we should be able to know what all
>> hand made SQLs have been executed in past (which can date back as
>> long as 1 year even)
> You have to adjust log_statement in your postgresql.conf however you
> will have to bear in mind the performance implications of this.
> Normal production sites dont do this. You can enable/disable this
> kind of logging any time by killing -HUP
I am thinking that is a bit more than what you want. You can log all sql
statements run on a server but the server can't differentiate between
your custom-app sent sql and hand made sql sent through psql.
I know you can add things like remote address, username, dbname,
sessionid to the start of each log line but I don't know of getting the
client app name.
My thought would be to enable the statement logging and to modify your
client apps to have a set comment at the beginning and end of all sql
statements sent. You could then filter these sql statements out of the
logs leaving you with hand crafted sql.
pgSQL (at) Sheeky (dot) Biz
Get Sheeky @ http://Sheeky.Biz
In response to
pgsql-admin by date
|Next:||From: Francisco Reyes||Date: 2008-07-22 19:30:21|
|Subject: Re: [ADMIN] shared_buffers and shmmax|
|Previous:||From: Rajesh Kumar Mallah||Date: 2008-07-22 17:40:11|
|Subject: Re: conditional logging based on client|