Received: from btclick.com (mta01.btfusion.com [62.172.195.11]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1ECEDE44362 for ; Thu, 14 Feb 2002 07:14:14 -0500 (EST) (envelope-from graham@digitalplanit.com) Received: from [213.120.147.19] ([213.120.147.19]) by btclick.com (Netscape Messaging Server 4.15) with SMTP id GRIVBR02.KEE for ; Thu, 14 Feb 2002 12:14:15 +0000 From: "Graham Vickrage" To: "Postgres SQL" Subject: trigger on table Date: Thu, 14 Feb 2002 12:17:02 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200202/152 X-Sequence-Number: 6579 I am trying to create a trigger on a table that simply sets the last_updated field when any updates are made to that table. I have tried the following: - CREATE FUNCTION set_item_last_updated () RETURNS OPAQUE AS ' BEGIN UPDATE item SET last_updated = now(); RETURN OLD; END;' LANGUAGE 'plpgsql'; CREATE TRIGGER item_last_updated AFTER UPDATE ON item FOR EACH ROW EXECUTE PROCEDURE set_item_last_updated(); When I try to execute this it hangs and postmaster eventually runs out of memory. Is there a way to do it just using sql not plpsql? Why is it hanging? Thank in advance. Graham