Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id SAA07752 for ; Thu, 13 Apr 2000 18:40:01 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id SAA12555; Thu, 13 Apr 2000 18:39:10 -0400 (EDT) To: Philippe =?iso-8859-1?Q?Lef=E8vre?= cc: pgsql-sql@postgreSQL.org Subject: Re: Function xxxx() does no exist In-reply-to: <38F62DAE.3B8BBBE0@libertysurf.fr> References: <38F62DAE.3B8BBBE0@libertysurf.fr> Comments: In-reply-to Philippe =?iso-8859-1?Q?Lef=E8vre?= message dated "Thu, 13 Apr 2000 16:27:26 -0400" Date: Thu, 13 Apr 2000 18:39:10 -0400 Message-ID: <12552.955665550@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200004/150 Philippe =?iso-8859-1?Q?Lef=E8vre?= writes: > So I created: > CREATE FUNCTION chk_itheme_proc(int4) RETURNS int4 > AS 'SELECT COUNT(i_theme) FROM tbl_theme > WHERE i_theme = $1;' > LANGUAGE 'sql'; > and I created a trigger: > CREATE TRIGGER chk_itheme_trig BEFORE INSERT OR UPDATE ON tbl_article > FOR EACH ROW EXECUTE PROCEDURE chk_itheme_proc ('theme'); > but I get the message: > ERROR: CreateTrigger: function chk_itheme_proc() does not exist Poorly worded error message, I'd say. You have a function chk_itheme_proc(int4), but the trigger as you show it requires a function with a signature of chk_itheme_proc(text) or something close to it. Those are different functions. The error message ought to print out the expected parameter types to remind you about that... regards, tom lane