X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 566E2DB0B5 for ; Tue, 22 Nov 2005 11:14:19 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61338-02-2 for ; Tue, 22 Nov 2005 15:14:20 +0000 (GMT) X-Greylist: delayed 00:30:19.842474 by SQLgrey- Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id A0E41DB05B for ; Tue, 22 Nov 2005 11:14:13 -0400 (AST) Received: from mail43-s.fg.online.no (mail43-s.fg.online.no [148.122.161.43]) by svr2.postgresql.org (Postfix) with ESMTP id 5062AF0B51 for ; Tue, 22 Nov 2005 14:43:57 +0000 (GMT) Received: from [192.168.0.57] (062016183238.customer.alfanett.no [62.16.183.238]) by mail43.fg.online.no (8.13.5/8.13.5) with ESMTP id jAMEhmak019207 for ; Tue, 22 Nov 2005 15:43:49 +0100 (CET) From: "Leif B. Kristensen" To: pgsql-sql@postgresql.org Subject: Triggers Date: Tue, 22 Nov 2005 15:43:47 +0100 User-Agent: KMail/1.8.1 X-Face: %iea8o"[SI'kMDS.`hz7lU=?\^lC9J-]CVjo; f{4-C:$?uVUEjyN~uYFn%*aH_c3d09U>=?utf-8?q?x=0A=09TXtaoj=7EMV=2E8PgG7hik9=3BcCT2N6+u?=@Y{wH\p3*_f~FH9k,Wi74e[_l%.7b^'zJ)8S'^G<(=?utf-8?q?=3D=0A=09zw8=5CPMC3=27=7BKl9=2EzL*ks!b6wA?=,c~'F`k&Vq|ELDGa|4 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/192 X-Sequence-Number: 23443 I'm trying to understand triggers. I have read the documentation in the manual as well as the few pages in the Douglas book about the subject, but I don't see how to implement a trigger that simply updates a 'last_edit' date field in my 'persons' table whenever I do an insert or update into my 'participants' table; that is a trigger that basically does an "UPDATE persons SET 'last_edit' = NOW() WHERE persons.person_id = participants.person_fk". Is that even possible? -- Leif Biberg Kristensen | Registered Linux User #338009 http://solumslekt.org/ | Cruising with Gentoo/KDE