Re: Tracking SQLs that update data

From: Andy Colson <andy(at)squeakycode(dot)net>
To: Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Tracking SQLs that update data
Date: 2010-06-15 02:38:42
Message-ID: 4C16E7B2.1080209@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/14/2010 06:55 PM, Phoenix Kiula 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?
>
> Thanks for any ideas.
>

If you are on 8.5, this will be helpful:

http://www.depesz.com/index.php/2009/12/29/waiting-for-8-5-application-name-reporting/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adam Alkins 2010-06-15 02:47:53 Re: Does enterprisedb.com down?
Previous Message Scott Marlowe 2010-06-15 01:26:27 Re: Tracking SQLs that update data