Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 11CB42E0035 for ; Mon, 18 Feb 2008 12:31:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 93495-06 for ; Mon, 18 Feb 2008 12:31:53 -0400 (AST) Received: from acrmail.acceso.com.pe (unknown [190.81.51.227]) by postgresql.org (Postfix) with ESMTP id 3CE7E2E0039 for ; Mon, 18 Feb 2008 12:31:53 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by acrmail.acceso.com.pe (Postfix) with ESMTP id 0EC685B0A98 for ; Mon, 18 Feb 2008 11:29:52 -0500 (PET) Received: from acrmail.acceso.com.pe ([127.0.0.1]) by localhost (acrmail.acceso.com.pe [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bdqRsXcGKH5k for ; Mon, 18 Feb 2008 11:29:51 -0500 (PET) Received: from acceso.com.pe (localhost [127.0.0.1]) by acrmail.acceso.com.pe (Postfix) with ESMTP id 3B3EF5B0A87 for ; Mon, 18 Feb 2008 11:29:51 -0500 (PET) From: "dguevara" To: pgsql-admin@postgresql.org Subject: Trigger from a function Date: Mon, 18 Feb 2008 11:29:51 -0500 Message-Id: <20080218161525.M66419@acceso.com.pe> X-Mailer: OpenWebMail 2.52 20060502 X-OriginatingIP: 192.168.2.11 (dguevara) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.1 tagged_above=0 required=5 tests=RDNS_NONE=0.1 X-Spam-Level: X-Archive-Number: 200802/190 X-Sequence-Number: 28264 Hello all, I have a problem with a trigger which is executed when i make an UPDATE trought a simple query, but not when the UPDATE is made in a store procedure. Maybe i'm missing something in the declaration of the function and i would appreciate any help. T his is the function: CREATE OR REPLACE FUNCTION X RETURNS SETOF void AS $BODY$ begin update A; end; $BODY$ LANGUAGE 'plpgsql' VOLATILE; The trigger: CREATE TRIGGER Y BEFORE INSERT OR UPDATE ON A FOR EACH ROW EXECUTE PROCEDURE Z; CREATE OR REPLACE FUNCTION Z RETURNS "trigger" AS $BODY$ begin if (tg_op in ('INSERT', 'UPDATE', 'DELETE')) then update A; end if; $BODY$ LANGUAGE 'plpgsql' VOLATILE; Thanks in advance. Danilo Guevara Departamento de Sistemas Acceso Crediticio SAC