RE: [GENERAL] About triggers

From: Michael J Davis <michael(dot)j(dot)davis(at)tvguide(dot)com>
To: "'Roberto Moreda'" <moreda(at)sanluis(dot)net>, gpsql-general <pgsql-general(at)hub(dot)org>
Subject: RE: [GENERAL] About triggers
Date: 1999-08-13 14:54:50
Message-ID: 93C04F1F5173D211A27900105AA8FCFC29917C@lambic.prevuenet.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Trigger functions must return opaque. Try

CREATE FUNCTION testf()
RETURNS opaque
AS
'INSERT INTO TEST VALUES(\'Hi\');
...
...
return new;'
LANGUAGE 'sql';

-----Original Message-----
From: Roberto Moreda [SMTP:moreda(at)sanluis(dot)net]
Sent: Friday, August 13, 1999 3:34 AM
To: gpsql-general
Subject: [GENERAL] About triggers

I do the following :

CREATE FUNCTION testf()
RETURNS bool
AS
'INSERT INTO TEST VALUES(\'Hi\');
...
...
SELECT true;'
LANGUAGE 'sql';

then :

CREATE TRIGGER syn_section_insert
AFTER INSERT ON SECTION FOR EACH ROW
EXECUTE PROCEDURE testf();

... and I obtain

ERROR: CreateTrigger: function testf () does not exist

but function exists...

What's the problem?

TIA.

Roberto

--
Roberto Moreda
Resp. Dpto. Informática Handem/San Luis
Tlf +34 981 779000
Fax +34 981 779022
Pol. Piadela Sur, Autovía A6 Sal.567
15300 Betanzos (A Coruña) - España

Browse pgsql-general by date

  From Date Subject
Next Message gavin 1999-08-13 15:53:21 plpgsql PqReadData()
Previous Message Héctor Morales 1999-08-13 14:32:40 Problem with compiled C