Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group