Re: Tracking SQLs that update data - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Tracking SQLs that update data
Date
Msg-id AANLkTilFrS3VQYLoJDRc9qTgpVg32XM6GCwbv8kAKSPI@mail.gmail.com
Whole thread Raw
In response to Re: Tracking SQLs that update data  (Phoenix Kiula <phoenix.kiula@gmail.com>)
List pgsql-general
On Sat, Jun 19, 2010 at 5:28 AM, Phoenix Kiula <phoenix.kiula@gmail.com> wrote:
>> It's far easier to adjust the logging.
>>
>> psql mydb
>> alter mydb set log_statement='mod';
>
>
>
> Thanks Scott.
>
> Two questions:
>
> 1. Will this log_statement='mod' be a permanent thing, or when I have
> done my testing and identifying the problem SQL, I can set it back to
> default so not too much logging is being done?

Just alter it back to 'none' when you're done.  Note you can also set
it per user, so if it's a certain user you want to log you can only
log their statements.

> 2. After this statement, how or where do I find the culprit SQL?

They should be in the postgresql logs.

pgsql-general by date:

Previous
From: Teodor Macicas
Date:
Subject: Re: Inserting additional data into pg_statistics
Next
From: David Goodenough
Date:
Subject: A thought about other open source projects