pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Function and trigger problem
3+ messages / 2 participants
[nested] [flat]

* Function and trigger problem
@ 1999-05-18 16:25 Adam H. Pendleton <apendleton@vgsinc.com>
  1999-05-18 17:28 ` Re: [SQL] Function and trigger problem Adam H. Pendleton <apendleton@vgsinc.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Adam H. Pendleton @ 1999-05-18 16:25 UTC (permalink / raw)
  To: pgsql-sql@hub.org

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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [SQL] Function and trigger problem
  1999-05-18 16:25 Function and trigger problem Adam H. Pendleton <apendleton@vgsinc.com>
@ 1999-05-18 17:28 ` Adam H. Pendleton <apendleton@vgsinc.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Adam H. Pendleton @ 1999-05-18 17:28 UTC (permalink / raw)
  To: pgsql-sql@hub.org

When I try to execute my insert, I am now getting this error:

java.sql.SQLException: ERROR:  stat failed on file
$/usr/local/pgsql/lib/plpgsql.so

What is it trying to do and why isn't it working.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* RE: [SQL] Function and trigger problem
@ 1999-05-18 16:53 Michael J Davis <michael.j.davis@tvguide.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael J Davis @ 1999-05-18 16:53 UTC (permalink / raw)
  To: 'Adam H. Pendleton' <apendleton@vgsinc.com>; pgsql-sql@hub.org

Trigger functions must return OPAQUE (OLD or NEW).


	-----Original Message-----
	From:	Adam H. Pendleton [SMTP:apendleton@vgsinc.com]
	Sent:	Tuesday, May 18, 1999 10:25 AM
	To:	pgsql-sql@hub.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
	



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1999-05-18 17:28 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-05-18 16:25 Function and trigger problem Adam H. Pendleton <apendleton@vgsinc.com>
1999-05-18 17:28 ` Adam H. Pendleton <apendleton@vgsinc.com>
1999-05-18 16:53 RE: [SQL] Function and trigger problem Michael J Davis <michael.j.davis@tvguide.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox