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

From Scott Marlowe
Subject Re: Tracking SQLs that update data
Date
Msg-id AANLkTikTTNQuSU1VDv2sMXmDltv4opRCGoch2CAkbJ0_@mail.gmail.com
Whole thread Raw
In response to Tracking SQLs that update data  (Phoenix Kiula <phoenix.kiula@gmail.com>)
Responses Re: Tracking SQLs that update data
Re: Tracking SQLs that update data
List pgsql-general
On Mon, Jun 14, 2010 at 5:55 PM, Phoenix Kiula <phoenix.kiula@gmail.com> wrote:
> Hi
>
> I'm having some issues with a code base where several different
> programs are updating one "status" column in the DB with their code.
> Mostly this is working, but in some cases the status column in a DB is
> getting updated when it shouldn't have been, and we're trying to
> locate which program did it.
>
> While checking through all the code, I'm also wondering if it is
> possible to somehow maintain a log of which SQL did the updating?
>
> My question: how can I set up a "RULE" so that when a specific column
> is updated, a separate table also logs which update SQL was issued?

It's far easier to adjust the logging.

psql mydb
alter mydb set log_statement='mod';

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: DDL partitioning with insert trigger issue
Next
From: "M. Bashir Al-Noimi"
Date:
Subject: Re: Unable to install pg in Win (MVR error)