Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6C4CE4767C6 for ; Fri, 10 Jan 2003 17:14:21 -0500 (EST) Received: from 66.171.36.107 (107.36.171.66.subscriber.vzavenue.net [66.171.36.107]) by postgresql.org (Postfix) with ESMTP id 5D5204766E3 for ; Fri, 10 Jan 2003 17:14:07 -0500 (EST) Received: (qmail 74272 invoked from network); 10 Jan 2003 22:13:10 -0000 Received: from unknown (HELO frodo) ([66.171.36.106]) (envelope-sender ) by 0 (qmail-ldap-1.03) with SMTP for ; 10 Jan 2003 22:13:10 -0000 Message-ID: <001c01c2b8f6$ce15dc80$fd00000a@pod13.com> From: "Dave A." To: Subject: function does not exist Date: Fri, 10 Jan 2003 17:22:47 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/157 X-Sequence-Number: 11022 I am using postgresql version 7.2.3, and have the following situation. When I attempt to add a function, I get the error CreateTrigger: function mem_leveled() does not exist. Using the function in psql (i.e. SELECT mem_leveled('fubar', 4, '2002/12/30 10:09:00 GMT'); ) works fine, I just can't create a trigger for it. I know its something stupid I'm doing (or not doing). CREATE TABLE members ( name CHARACTER VARYING(256), level smallint, date_updated timestamptz, ... other stuff ... ) CREATE TABLE mem_history ( name CHARACTER VARYING(256), level smallint, date_achieved timestamptz ) CREATE FUNCTION mem_leveled (varchar, smallint, timestamptz) RETURN BOOLEAN AS 'DELCARE mem_lvl RECORD; BEGIN SELECT INTO mem_lvl * FROM mem_history WHERE name = $1 AND level = $2; IF NOT FOUND THEN INSERT INTO mem_history VALUES ($1, $2, $3); END IF; RETURN TRUE; END; ' LANGUAGE 'plpgsql'; CREATE TRIGGER update_mem_level AFTER INSERT OR UPDATE ON members FOR EACH ROW EXECUTE PROCEDURE mem_leveled('name', 'level', 'date_updated'); ------ Dave A.