Re: SQL function triggers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SQL function triggers
Дата
Msg-id 14677.1034690834@sss.pgh.pa.us
обсуждение исходный текст
Ответ на SQL function triggers  (Brian Blaha <bblaha@umr.edu>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Stored procedure returning row or resultset
Следующее
От: Jeff
Дата:
Сообщение: Re: how do i insert an empty string ?