Received: from imag.imag.fr (imag.imag.fr [129.88.30.1]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9HHOnP89075 for ; Wed, 17 Oct 2001 13:24:49 -0400 (EDT) (envelope-from Nicolas.Kowalski@imag.fr) Received: from ormelune.imag.fr (ormelune.imag.fr [129.88.43.35]) by imag.imag.fr (8.11.6/8.11.6) with ESMTP id f9HHOlc21210 for ; Wed, 17 Oct 2001 19:24:47 +0200 (MEST) Received: from brevent.imag.fr.imag.fr (brevent [129.88.43.25]) by ormelune.imag.fr (8.9.1b+Sun/jtpda-5.3.3) with SMTP id TAA17433 for ; Wed, 17 Oct 2001 19:24:36 +0200 (MET DST) To: pgsql-admin@postgresql.org Subject: update in rule X-Face: #v^9{p"~.e3TDs~r\ Date: Wed, 17 Oct 2001 19:24:42 +0200 Message-ID: Lines: 33 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.1 (Capitol Reef) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200110/159 X-Sequence-Number: 2404 Hello. We are running PostgreSQL 7.1.3 on Debian GNU/Linux. We maintain for our intranet something like an addressbook : =# \d adresses Table "adresses" Attribute | Type | Modifier --------------+------------------------+---------------------------------------- id | integer | default nextval('adresses_id_seq'::text) date_maj | date | default 'NOW' Index: adresses_pkey I would like to automatically update the `date_maj' field with the current day date whenever an update on a row occurs. So I created a rule like : CREATE RULE adresses_date_maj AS ON UPDATE TO adresses DO UPDATE adresses SET date_maj = 'NOW' ; But as says the documentation, this does not work (circular problem). Does anyone known how to achieve such a behaviour ? Thanks in advance, Nicolas.