Re: history tables with only one function?
От | Tom Lane |
---|---|
Тема | Re: history tables with only one function? |
Дата | |
Msg-id | 28841.1092322639@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: history tables with only one function? (Raphael Bauduin <raphael.bauduin@be.easynet.net>) |
Ответы |
Re: history tables with only one function?
|
Список | pgsql-general |
Raphael Bauduin <raphael.bauduin@be.easynet.net> writes: >> Could you please confirm that your function works as you described? > It works as expected: > log=# DROP TRIGGER "customers_update_log_t" on "customers"; > DROP TRIGGER > log=# DROP FUNCTION "update_log"(); > ERROR: function update_log() does not exist > log=# CREATE FUNCTION "update_log"(text) RETURNS trigger AS ' > log'# BEGIN > log'# insert into $1_log select new.*,''UPDATE''; > log'# return new; > log'# END; > log'# ' LANGUAGE 'plpgsql'; > CREATE FUNCTION > log=# > log=# CREATE TRIGGER "customers_update_log_t" after UPDATE on "customers" for each row execute procedure "customers_update_log"('customers'); > CREATE TRIGGER That trigger is not executing that function, and would not be executing it even if you had used the same function name. Trigger functions are always parameterless. regards, tom lane
В списке pgsql-general по дате отправления: