default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP

From: f g <fg0fg1(at)yahoo(dot)fr>
To: pgsql-novice(at)postgresql(dot)org
Subject: default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
Date: 2006-01-23 13:49:58
Message-ID: 20060123134958.72090.qmail@web26114.mail.ukl.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

with mysql you can do:

CREATE TABLE [table]
...
stamp timestamp NOT NULL default CURRENT_TIMESTAMP on
update CURRENT_TIMESTAMP,
...

but with pgsql it seems you need to do a trigger:

CREATE RULE [rule] AS ON UPDATE TO [table] DO UPDATE
[table] SET stamp = CURRENT_TIMESTAMP \g

which give you:

ERROR: infinite recursion detected in rules for
relation [table]

what's the trick???



___________________________________________________________________________
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message A. Kretschmer 2006-01-23 14:31:34 Re: default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
Previous Message Rolf stvik 2006-01-23 09:00:06 Re: msysconf error