Re: triggers and functions in pgsql 7.0.2 - Mailing list pgsql-general

From philip@adhesivemedia.com (Philip Hallstrom)
Subject Re: triggers and functions in pgsql 7.0.2
Date
Msg-id 200006131930.MAA01137@illiad.adhesivemedia.com
Whole thread Raw
In response to triggers and functions in pgsql 7.0.2  (Marc Britten <mbritten@cybernet-usa.com>)
Responses Re: triggers and functions in pgsql 7.0.2  (JanWieck@t-online.de (Jan Wieck))
List pgsql-general
I had this same problem... plpgsql is not built be default (at least for
7.0).  take a look at src/pl/plpgsql/src/INSTALL.  You just need to add
it... then switch your language back to plpgsql and it should work
(well, maybe it won't, but it shouldn't complain about not finding
plpgsql)
good luck!
-philip
In article <am.pgsql.general.960922068.691@illiad.adhesivemedia.com>,
Marc Britten  <mbritten@cybernet-usa.com> wrote:
>I'm going through your docs trying to create a function and a trigger that
>calls said function, what I've gotten so far is
>CREATE FUNCTION create_count_cache()
>       RETURNS opaque AS
>       '
>     BEGIN;
>     DELETE FROM SnipCount;
>     INSERT INTO SnipCount SELECT LangID, COUNT(LangID) AS CNT FROM
>snippet GROUP BY LangID;
>     COMMIT;
>       '
>       LANGUAGE 'sql';
>CREATE TRIGGER count_change
>       AFTER DELETE OR INSERT ON snippet FOR EACH ROW
>       EXECUTE PROCEDURE create_count_cache();
>however LANGUAGE sql cannot return opaque and plpgsql is not a known lang
>type.
>it seems that all your docs are a bit out of date, can you give me some help
>please?
>marc britten


pgsql-general by date:

Previous
From: Ed Loehr
Date:
Subject: Re: triggers and functions in pgsql 7.0.2
Next
From: Haroldo Stenger
Date:
Subject: Revisited: Does error within transaction imply restarting it?