On Tue, 25 Nov 2014 21:41:12 +0100
Alban Hertroys <haramrae@gmail.com> wrote:
> Hi all,
>
> In the past, when writing trigger functions, I?ve always used pl/pgsql without giving it a second thought. Today I
wasmodifying a database creation script that was originally intended for Firebird to work with Postgres and the example
triggerprocedures in there were very close to pure SQL.
>
> Hence, I started rewriting them as SQL functions, but is that really possible? The return-type for trigger functions
isusually ?returns trigger?, which I don?t know how to translate to SQL. Next to that, what should the SQL statement
insidethe function be returning?
Last I checked, triggers had to be written in a language that could "return
trigger". A look at the 9.4 documentation seems to suggest that this is
still a requirement, although I didn't find a definitive statement to that
effect.
Since stored procedures written in SQL are unable to return the trigger type,
it's not currently possible to write triggers in SQL.
--
Bill Moran
I need your help to succeed:
http://gamesbybill.com