Re: SQL function triggers - Mailing list pgsql-sql

From Tom Lane
Subject Re: SQL function triggers
Date
Msg-id 14677.1034690834@sss.pgh.pa.us
Whole thread Raw
In response to SQL function triggers  (Brian Blaha <bblaha@umr.edu>)
List pgsql-sql
Brian Blaha <bblaha@umr.edu> writes:
> I would like to write a function as a set of SQL statements, and then 
> use that function
> in a trigger. However, since triggers require a return type of opaque, 
> and SQL functions
> cannot return type opaque, this doesn't look possible.

You could call a SQL function from a trigger, but it can't be a trigger
itself; at present triggers have to be in C, plpgsql, or pltcl (maybe
plpython?  Not sure about that one).

For what you are doing (transferring info from one table to another)
I suspect a rule might work better than a trigger anyway.
        regards, tom lane


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Stored procedure returning row or resultset
Next
From: Jeff
Date:
Subject: Re: how do i insert an empty string ?