Re: Get current query in a trigger function

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Vlad Arkhipov <arhipov(at)dc(dot)baikal(dot)ru>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Get current query in a trigger function
Date: 2013-01-14 16:45:38
Message-ID: CA+TgmoZsvazMdN64O5yAnUM-3OAYp3RuBEKMjtB_1w_2LuwZSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 11, 2013 at 4:47 AM, Vlad Arkhipov <arhipov(at)dc(dot)baikal(dot)ru> wrote:
> Is there any simple way of getting a query for which a trigger was executed?
> debug_query_string and ActivePortal->sourceText return the top query when
> there are nested triggers.

I believe - only if the trigger is written in C.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Boszormenyi Zoltan 2013-01-14 16:49:49 Re: pg_ctl idempotent option
Previous Message Robert Haas 2013-01-14 16:45:01 Re: [PERFORM] Slow query: bitmap scan troubles