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

Re: Function xxxx() does no exist

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philippe Lefèvre <ph(dot)l(at)libertysurf(dot)fr>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: Function xxxx() does no exist
Date: 2000-04-13 22:39:10
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Philippe =?iso-8859-1?Q?Lef=E8vre?= <ph(dot)l(at)libertysurf(dot)fr> 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

In response to


pgsql-sql by date

Next:From: Graeme MerrallDate: 2000-04-14 04:55:45
Subject: sum a subquery?
Previous:From: Philippe LefèvreDate: 2000-04-13 20:27:26
Subject: Function xxxx() does no exist

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