Re: Determining weather a query fired a trigger - Mailing list pgsql-general

From Craig Ringer
Subject Re: Determining weather a query fired a trigger
Date
Msg-id 47FBB8FC.5050006@postnewspapers.com.au
Whole thread Raw
In response to Determining weather a query fired a trigger  (Gordon <gordon.mcvey@ntlworld.com>)
List pgsql-general
Gordon wrote:
>
> So what I want to know is, is there a way to tell if executing a query
> caused a trigger to fire?   I don't need anything fancy like notify
> and listen, I just want to see what the database is doing for testing
> purposes.  For example by looking at the logs and seeing what activity
> was caused by a given query.  Does this stuff get logged?
>

If you can modify the trigger and it's written in PL/PgSQL you can use a
`RAISE NOTICE' statement to log some information when the trigger fires.
Those are several big "if"s though.

--
Craig Ringer


pgsql-general by date:

Previous
From: Shane Ambler
Date:
Subject: Re: High Availability / Replication with Sequoia
Next
From: Tom Lane
Date:
Subject: Re: "too many trigger records found for relation xyz"