Re: history tables with only one function?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Raphael Bauduin <raphael(dot)bauduin(at)be(dot)easynet(dot)net>
Cc: Andreas Haumer <andreas(at)xss(dot)co(dot)at>, pgsql-general(at)postgresql(dot)org
Subject: Re: history tables with only one function?
Date: 2004-08-12 14:57:19
Message-ID: 28841.1092322639@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Raphael Bauduin <raphael(dot)bauduin(at)be(dot)easynet(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2004-08-12 14:58:15 Re: Replication options?
Previous Message Paramveer.Singh 2004-08-12 14:52:43 Re: pl pgsql grammer file contains error