Re: conditional logging based on client - Mailing list pgsql-admin

From Scott Marlowe
Subject Re: conditional logging based on client
Date
Msg-id dcc563d10807231022g24d7e5e7v6636da3fc458583a@mail.gmail.com
Whole thread Raw
In response to Re: conditional logging based on client  ("Rajesh Kumar Mallah" <mallah.rajesh@gmail.com>)
Responses Re: conditional logging based on client  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
2008/7/22 Rajesh Kumar Mallah <mallah.rajesh@gmail.com>:
> On Tue, Jul 22, 2008 at 5:54 PM, Achilleas Mantzios
> <achill@matrix.gatewaynet.com> wrote:
>> Στις Tuesday 22 July 2008 15:17:42 ο/η Rajesh Kumar Mallah έγραψε:
>>> Hi,
>>>
>>> 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
>
> thanks for reply.
> any hit on performance is not desired.
> is it possible to alter logging behaviour just for the
> psql session ?

Set log_statement='ddl' in your postgresql.conf and pgsql will log all
ddl that hits the database.  It won't log other stuff, just the ddl.

pgsql-admin by date:

Previous
From: Shane Ambler
Date:
Subject: Re: conditional logging based on client
Next
From: "Igor Neyman"
Date:
Subject: Re: Query a list of tables