Re: Determining weather a query fired a trigger

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Gordon <gordon(dot)mcvey(at)ntlworld(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Determining weather a query fired a trigger
Date: 2008-04-08 18:27:08
Message-ID: 47FBB8FC.5050006@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-04-08 18:30:48 Re: "too many trigger records found for relation xyz"
Previous Message Shane Ambler 2008-04-08 18:24:17 Re: High Availability / Replication with Sequoia