Re: debugging triggers - get original statement?

From: Luca Vernini <lucazeo(at)gmail(dot)com>
To: gmb <gmbouwer(at)gmail(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: debugging triggers - get original statement?
Date: 2014-01-15 11:22:15
Message-ID: CAHZ=uVCV-u25SEFSHaHWQshbRO0Lu037S4yRabN8=4kdSKo5ew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

2014/1/15 gmb <gmbouwer(at)gmail(dot)com>:
> I now want to add debugging to trigger_func_2 where I log the original
> statement (transaction?).
> I.e. I'm interested in something like "INSERT INTO table1.... "
> Anybody have any ideas on how I can get this original statement ?

You can log every single statement:
In postgresql.conf file, you can change the log_statement to 'all'.
BUT: it is dangerous in production: you can fill your file system very
fast and slow down the system.

Another way is: modify the trigger and write informations you need in
a specific table. Not an elegant solution but...

> Thanks
> GMB

Lucazeo.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message gmb 2014-01-15 11:30:07 Re: debugging triggers - get original statement?
Previous Message gmb 2014-01-15 08:52:05 debugging triggers - get original statement?