triggers and functions in pgsql 7.0.2

From: Marc Britten <mbritten(at)cybernet-usa(dot)com>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: triggers and functions in pgsql 7.0.2
Date: 2000-06-13 18:50:21
Message-ID: ABFF67479EC9D111AFA30060B01AACDA03ADF684@mail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Mascari 2000-06-13 18:57:38 Re: triggers and functions in pgsql 7.0.2
Previous Message Jurgen Defurne 2000-06-13 17:27:30 Re: DBI problems with Pg