Received: from computalog.com ([209.82.103.230]) by hub.org (8.9.3/8.9.3) with ESMTP id RAA65847 for ; Mon, 10 Jan 2000 17:32:11 -0500 (EST) (envelope-from werner.fraga@computalog.com) Received: from tserver.edmonton.computalog.com (mug.computalog.com [209.82.103.229]) by computalog.com (8.8.7/8.8.7) with ESMTP id PAA05067 for ; Mon, 10 Jan 2000 15:45:55 -0700 Received: from shorty.edmonton.computalog.com (wfraga@shorty [10.89.4.26]) by tserver.edmonton.computalog.com (8.8.7/8.8.7) with SMTP id PAA02134 for ; Mon, 10 Jan 2000 15:32:49 -0700 From: Werner Fraga Reply-To: werner.fraga@computalog.com Organization: Computalog Ltd. To: pgsql-sql@postgresql.org Subject: problems creating functions and triggers Date: Mon, 10 Jan 2000 15:32:19 -0700 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain MIME-Version: 1.0 Message-Id: <00011015363303.07948@shorty.edmonton.computalog.com> Content-Transfer-Encoding: 8bit I am having problems creating functions and triggers in Postgres 6.5.3 on Linux Mandrake 6.1. 1. I noticed that some examples show the LANGUAGE in the CREATE FUNCTION command can be 'plpgsql'. However, if I try using this instead of 'sql', I get ERROR: Unrecognized language specified in a CREATE FUNCTION ... However, I read somewhere that triggers don't work with LANGUAGE 'sql'. Am I missing some part of Postgres installation? 2. If I create a function successfully (with LANGUAGE 'sql', then try to create a trigger using this function, I get create function checkStationID (int4) returns int4 as 'select Station.StationID from Station where Station.StationID = $1;' language 'SQL'; CREATE create trigger ifStationExists BEFORE INSERT OR UPDATE ON Employee FOR EACH ROW EXECUTE PROCEDURE checkStationID (stationID); ERROR: CreateTrigger: function checkstationid() does not exist Is this because LANGUAGE should be 'plpgsql'? The function does exist; I can run it using 'Select checkStationID (5)'. 3. Is there anywhere I can find a list of the system tables? (that section in Bruce's book is still empty...)