Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3MCq-0001v6-Km for pgsql-sql@arkaria.postgresql.org; Wed, 15 Jan 2014 08:52:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W3MCp-0004Hb-Sn for pgsql-sql@arkaria.postgresql.org; Wed, 15 Jan 2014 08:52:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3MCo-0004HU-UO for pgsql-sql@postgresql.org; Wed, 15 Jan 2014 08:52:10 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3MCl-0008Gd-G5 for pgsql-sql@postgresql.org; Wed, 15 Jan 2014 08:52:10 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1W3MCj-0002bE-CB for pgsql-sql@postgresql.org; Wed, 15 Jan 2014 00:52:05 -0800 Date: Wed, 15 Jan 2014 00:52:05 -0800 (PST) From: gmb To: pgsql-sql@postgresql.org Message-ID: <1389775925366-5787181.post@n5.nabble.com> Subject: debugging triggers - get original statement? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Hi I have a situation where a summary table is updated via triggers on multiple tables. E.g. an insert is done on table1; a trigger (trigger_func_1) then causes an update on table2 , which in turn update table3 using another trigger (trigger_func_2). I'm encountering invalid data on table3 and I suspect a bug in trigger_func_2. 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 ? Thanks GMB -- View this message in context: http://postgresql.1045698.n5.nabble.com/debugging-triggers-get-original-statement-tp5787181.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql