X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 117D8D1B562 for ; Sat, 1 Nov 2003 13:51:18 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 34872-03 for ; Sat, 1 Nov 2003 09:50:50 -0400 (AST) Received: from bugs.unl.edu.ar (bugs.unl.edu.ar [168.96.132.208]) by svr1.postgresql.org (Postfix) with ESMTP id 481D1D1B561 for ; Sat, 1 Nov 2003 09:50:46 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 976FA11DCF for ; Sat, 1 Nov 2003 10:49:41 -0300 (ART) Received: from bugs.unl.edu.ar ([127.0.0.1]) by localhost (bugs [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10659-01 for ; Sat, 1 Nov 2003 10:49:20 -0300 (ART) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 98F1311DC6 for ; Sat, 1 Nov 2003 10:49:19 -0300 (ART) From: Martin Marques To: pgsql-sql@postgresql.org Subject: defaults on updates Date: Sat, 1 Nov 2003 10:49:17 -0300 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200311011049.17325.martin@bugs.unl.edu.ar> X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at unl.edu.ar X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/1 X-Sequence-Number: 15816 Hi, I'm trying to make some sort of function, rule, trigger, or what ever that= =20 would be capable of modifing my table on an update. Basically, I have 5 fields, one being a PK (SERIAL), 3 with information, an= d=20 the last one a timestamp field that will show the last time the register wa= s=20 modified (tmodif which has a DEFAULT CURRENT_TIMESTAMP). Now, eveytime someone modifys any, or all of the 3 information fields, I wa= nt=20 the tmodif field of that register to be set to now(). I tried with rules, b= ut=20 just didn't work (obviously, and not so), even with INSTEAD. The only way I see of doing it is through a view/rule, but I would leave th= at=20 as the last resource. Any ideas? --=20 10:43:01 up 10 days, 18:05, 4 users, load average: 0.95, 0.44, 0.35 ----------------------------------------------------------------- Mart=EDn Marqu=E9s | select 'mmarques' || '@' || 'unl.edu.ar' Centro de Telematica | DBA, Programador, Administrador Universidad Nacional del Litoral -----------------------------------------------------------------