Michael Rowan
2012-08-28 23:22:23 UTC
Hi
In Postgres 9.1 I have a function as a test (of my ability):
CREATE OR REPLACE FUNCTION insert_payment(integer, numeric)
RETURNS numeric AS
$BODY$
UPDATE company
SET co_payments=co_payments+$2
WHERE co_id=$1
RETURNING co_payments;
$BODY$
LANGUAGE sql VOLATILE
COST 100;
ALTER FUNCTION insert_payment(integer, numeric)
OWNER TO postgres;
This function exists, according to pgAdminIII
So I attempt to create a trigger:
CREATE TRIGGER increment_payments
AFTER INSERT ON payment
FOR EACH ROW
EXECUTE PROCEDURE insert_payment();
ERROR: function insert_payment() does not exist
What am I doing wrong here?
Michael Rowan
***@internode.on.net
11 Kingscote Street
ALBERTON
South Australia 5014
tel 618 8240 3993
mob 0417 812 509
In Postgres 9.1 I have a function as a test (of my ability):
CREATE OR REPLACE FUNCTION insert_payment(integer, numeric)
RETURNS numeric AS
$BODY$
UPDATE company
SET co_payments=co_payments+$2
WHERE co_id=$1
RETURNING co_payments;
$BODY$
LANGUAGE sql VOLATILE
COST 100;
ALTER FUNCTION insert_payment(integer, numeric)
OWNER TO postgres;
This function exists, according to pgAdminIII
So I attempt to create a trigger:
CREATE TRIGGER increment_payments
AFTER INSERT ON payment
FOR EACH ROW
EXECUTE PROCEDURE insert_payment();
ERROR: function insert_payment() does not exist
What am I doing wrong here?
Michael Rowan
***@internode.on.net
11 Kingscote Street
ALBERTON
South Australia 5014
tel 618 8240 3993
mob 0417 812 509