Stored Procedure Problem - Mailing list pgsql-general

From Mike Marconi
Subject Stored Procedure Problem
Date
Msg-id 20020523191006.69817.qmail@web21503.mail.yahoo.com
Whole thread Raw
Responses Re: Stored Procedure Problem
List pgsql-general
I set up my database to include lang plpgsql.
When trying to create this simple stored procedure and
trigger below, the procedure is created but the
trigger fails.
the error returned is

"psql:importPageDataFunction:25: ERROR:
CreateTrigger: function pagedata_insert() does not
exist".

 CREATE FUNCTION pagedata_insert
(integer,integer,integer,integer,integer,integer,integer)
RETURNS opaque AS '

    DECLARE
        g ALIAS FOR $1;
        z ALIAS FOR $2;
        t ALIAS FOR $3;
        p ALIAS FOR $4;
        r ALIAS FOR $5;
        s ALIAS FOR $6;
        temp ALIAS FOR $7;
    BEGIN
        IF tempid IS NULL THEN
            tempid := (SELECT template FROM signs WHERE id =
sid);
        END IF;

        INSERT INTO pagedata (gid, zid, tid, page, rid, sid,
tempid) VALUES (g, z, t, p, r, s, temp);

        RETURN NULL;
    END;

' LANGUAGE 'plpgsql';

CREATE TRIGGER insertpagedata BEFORE INSERT
    ON pagedata FOR EACH ROW EXECUTE
PROCEDURE pagedata_insert (gid, zid, tid, page, rid,
sid, tempid);

I have notice that the procedure is in pg_proc, but if
you refer to it with "Drop Function pagedata_insert"
it won't find it either.
If I take out the argument declaration both objects
are created successfully.

thanks in advance

Mike Marconi

__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

pgsql-general by date:

Previous
From: "Joel Burton"
Date:
Subject: Re: Violation of NOT NULL
Next
From: Niclas Gustafsson
Date:
Subject: Indices for both where and order by.