RE: [SQL] Function and trigger problem

From: Michael J Davis <michael(dot)j(dot)davis(at)tvguide(dot)com>
To: "'Adam H(dot) Pendleton'" <apendleton(at)vgsinc(dot)com>, pgsql-sql(at)hub(dot)org
Subject: RE: [SQL] Function and trigger problem
Date: 1999-05-18 16:53:39
Message-ID: 93C04F1F5173D211A27900105AA8FCFC145511@lambic.prevuenet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Trigger functions must return OPAQUE (OLD or NEW).

-----Original Message-----
From: Adam H. Pendleton [SMTP:apendleton(at)vgsinc(dot)com]
Sent: Tuesday, May 18, 1999 10:25 AM
To: pgsql-sql(at)hub(dot)org
Subject: [SQL] Function and trigger problem

I use the following code to create a function:

create function employee_stats_update() returns int4
as 'insert into employee_stats values (
new.employee_name);
select 1 as ignore_this'
language 'plpgsql';

Then I create the following trigger:

create trigger update_employee_stats
before insert on employee_master for each row
execute procedure employee_stats_update();

This is what I get back when I try to create the trigger:

ERROR: CreateTrigger: function employee_stats_update () does not
exist

Adam

Browse pgsql-sql by date

  From Date Subject
Next Message Adam H. Pendleton 1999-05-18 17:28:38 Re: [SQL] Function and trigger problem
Previous Message Adam H. Pendleton 1999-05-18 16:25:22 Function and trigger problem