more trouble with triggers/functions

From: "chris markiewicz" <cmarkiew(at)commnav(dot)com>
To: "Postgres \(E-mail\)" <pgsql-general(at)postgresql(dot)org>
Subject: more trouble with triggers/functions
Date: 2000-10-02 19:27:53
Message-ID: 006a01c02ca6$dcb470a0$dbb846c6@cmarkiewicz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hello.

a quick note - i have not recieved a single [GENERAL] post since friday,
9/29. is anyone else having this problem or just me?

on to my question...i have been trying to create a trigger or
trigger/function combination but i have so far been unsuccessful. my task
is simple, when someone inserts a row in the PERSON table, create a row in
the RESOURCE table (note that i have to pass parameters). details below...

first, the basic procedure and trigger are shown here:

CREATE FUNCTION sp_person_resource() RETURNS bool
AS 'insert into resource(rid, name, type, desc) values (1905, ''chris'',
''person'', ''blah''); select true;'
LANGUAGE 'sql';

CREATE TRIGGER trig_person_resource BEFORE INSERT ON person
FOR EACH ROW EXECUTE PROCEDURE sp_person_resource();

i do not know what to use for a return type (i don't really need to return
anything). but when i try to write a trigger to call that fn, it tells me
that the fn must return opaque...i modify my proc but it tells me that "sql
fns cannot return type opaque."

what's going on? what is opaque?

thanks
chris

Browse pgsql-general by date

  From Date Subject
Next Message KMiller 2000-10-02 19:38:18 Pg.pm - Can't locate loadable object ...
Previous Message Efrain Caro 2000-10-02 18:32:20 Delphi PostgreSQL Forum