Skip site navigation (1) Skip section navigation (2)

Re: conditional logging based on client

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Rajesh Kumar Mallah" <mallah(dot)rajesh(at)gmail(dot)com>
Cc: "Achilleas Mantzios" <achill(at)matrix(dot)gatewaynet(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: conditional logging based on client
Date: 2008-07-23 17:22:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
2008/7/22 Rajesh Kumar Mallah <mallah(dot)rajesh(at)gmail(dot)com>:
> On Tue, Jul 22, 2008 at 5:54 PM, Achilleas Mantzios
> <achill(at)matrix(dot)gatewaynet(dot)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.

In response to


pgsql-admin by date

Next:From: Igor NeymanDate: 2008-07-23 18:22:00
Subject: Re: Query a list of tables
Previous:From: Shane AmblerDate: 2008-07-23 16:44:25
Subject: Re: conditional logging based on client

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group