Re: Fwd: Start up question about triggers - Mailing list pgsql-sql

From Richard Broersma Jr
Subject Re: Fwd: Start up question about triggers
Date
Msg-id 20060623050930.29801.qmail@web31801.mail.mud.yahoo.com
Whole thread Raw
In response to Fwd: Start up question about triggers  ("Aaron Bono" <postgresql@aranya.com>)
Responses Re: Fwd: Start up question about triggers
List pgsql-sql
> I did some research and can't even find a way to get meta data in a trigger.
> 
> In a trigger, is there a way to inspect OLD and NEW to see what columns are
> there and see what has changed?  If so, you may not be able to grab the
> actual query but you could create a generic trigger that reconstructs a
> possible update/insert/delete for any table in your database.
> 
> Does anyone know of a good place to go get information about using meta data
> in a stored procedure or trigger?

yes.
See the section "User Comments" at the very bottom of Chapter 33 after "Writing Trigger Functions
in C".  It is odd that a PL_PGSQL example is given at the end a chapter for triggers written in C.

http://www.postgresql.org/docs/8.1/interactive/trigger-example.html

Also see the entire chapter 36.10 "Trigger Procedures"
http://www.postgresql.org/docs/8.1/interactive/plpgsql-trigger.html

Hope this is what you are looking for.

Regards,

Richard Broersma Jr.


pgsql-sql by date:

Previous
From: "Aaron Bono"
Date:
Subject: Fwd: Start up question about triggers
Next
From: "Forums @ Existanze"
Date:
Subject: Re: Fwd: Start up question about triggers