Skip site navigation (1) Skip section navigation (2)

function does not exist error...

From: Dan Jewett <danjewett(at)mac(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: function does not exist error...
Date: 2002-11-21 19:14:03
Message-ID: p05200f02ba02df1d4182@[162.84.132.56] (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-novice
Can someone help me figure out why my trigger can't meet my function? 
Other than the obvious reason that I'm a total beginner, and I don't 
know what the heck I'm doing. :-)

After I got the CreateTrigger error, I reran the CreateFunction query 
just to see what would happen:

recordings=> CREATE FUNCTION check_participant(varchar) RETURNS opaque AS '
	DECLARE name ALIAS FOR $1;
	BEGIN
	SELECT fname FROM participant WHERE fname = name; IF FOUND 
THEN RETURN 0;
	ELSE INSERT INTO artist (fname) VALUES (name); END IF; END;' 
LANGUAGE 'plpgsql';

ERROR:  function check_participant already exists with same argument types

recordings=> CREATE TRIGGER trigger_artist BEFORE INSERT ON participant
	FOR EACH ROW EXECUTE PROCEDURE check_participant();

ERROR:  CreateTrigger: function check_participant() does not exist

Responses

pgsql-novice by date

Next:From: Josh BerkusDate: 2002-11-21 21:33:16
Subject: Re: function does not exist error...
Previous:From: Tom LaneDate: 2002-11-21 16:04:13
Subject: Re: Error when creating a char column as primary key

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group