Re: date stamp on update? - Mailing list pgsql-general

From Martin Gainty
Subject Re: date stamp on update?
Date
Msg-id BAY122-W28E0B06E425A56676E7FCFAE0E0@phx.gbl
Whole thread Raw
In response to date stamp on update?  ("blackwater dev" <blackwaterdev@gmail.com>)
List pgsql-general



Create Table TableName(
ColumnName DATE Sysdate;
);
ALTER TABLE TableName
ALTER COLUMN ColumnName { SET DEFAULT newdefaultvalue | DROP OLDDEFAULT }

HTH
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.





Date: Sat, 22 Nov 2008 17:34:26 -0500
From: blackwaterdev@gmail.com
To: pgsql-general@postgresql.org
Subject: [GENERAL] date stamp on update?

Is there a datatype in postgres that will automatically update the date when the row is updated?  I know I can do a timestamp and set the default to now() but once the row is inserted, and then edited, I want the column updated without editing my application code or adding a trigger.  Is this possible with Postgres?

Thanks!


Proud to be a PC? Show the world. Download the “I’m a PC” Messenger themepack now. Download now.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: date stamp on update?
Next
From: Tom Lane
Date:
Subject: Re: delete commands fails silently to delete primary key