Re: history tables with only one function? - Mailing list pgsql-general

From Tom Lane
Subject Re: history tables with only one function?
Date
Msg-id 28841.1092322639@sss.pgh.pa.us
Whole thread Raw
In response to Re: history tables with only one function?  (Raphael Bauduin <raphael.bauduin@be.easynet.net>)
Responses Re: history tables with only one function?  (Raphael Bauduin <raphael.bauduin@be.easynet.net>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: datpath error
Next
From: Paramveer.Singh@trilogy.com
Date:
Subject: Re: pl pgsql grammer file contains error