Re: Trigger - Mailing list pgsql-sql

From Tom Lane
Subject Re: Trigger
Date
Msg-id 11167.963589742@sss.pgh.pa.us
Whole thread Raw
In response to Trigger  (Carolyn Lu Wong <carolyn@kss.net.au>)
List pgsql-sql
Carolyn Lu Wong <carolyn@kss.net.au> writes:
> In the "Interaction with the Trigger Manager" from the online document,
> it states that it's for V7.1 or later. Because I'm working on earlier
> version, do I need to modify my code if the database is upgraded to
> later versions?

The trigger interface for 7.0 is the same as in 6.5, so you can rely
on the online document for now.

7.1 will have a different trigger interface (but the document hasn't
been updated yet).  The key difference is that the TriggerData structure
will be passed as a parameter rather than being pointed to by a global
variable.  You can minimize the number of changes you will need to make
by not referring to CurrentTriggerData all over the place --- instead,
copy it into a local variable at the start of your trigger function.

> I'm writing the C program in under my home directory. How can I set up
> the environment so that my program compiles?

Easiest way is to point -I at the src/include tree, I'm afraid.  There
are some examples of C triggers in the contrib/ area, take a look at
their makefiles.
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: nevermind...
Next
From: Nathan Young
Date:
Subject: transactions within stored procedures