Stored Procedure Problem

From: Mike Marconi <mmpostlist(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Stored Procedure Problem
Date: 2002-05-23 19:10:06
Message-ID: 20020523191006.69817.qmail@web21503.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Niclas Gustafsson 2002-05-23 19:39:38 Indices for both where and order by.
Previous Message Joel Burton 2002-05-23 18:31:12 Re: Violation of NOT NULL