three timestamps/table, use of 'now' in table creation statement - Mailing list pgsql-general

From Dennis Gearon
Subject three timestamps/table, use of 'now' in table creation statement
Date
Msg-id 3E267679.6268AA41@cvc.net
Whole thread Raw
In response to postgres on a PDA  ("Al Bean" <albean84@hotmail.com>)
Responses Re: three timestamps/table, use of 'now' in table creation statement
List pgsql-general
I want to have three timestamps columns in a table:

'created'
'modified'
'archived'

not unlike more modern file systems.

What I want to happen is that all three columns get set with the 'now'
value to the nearest second, and they ALL have the exact same value.

I want to be able to compare 'created' with 'modified'
        to see if it's been modified,
I want to be able to compare 'created' with 'archived'
        to see if it's been archived.

I don't want to have NULL's with their propagation issues.

Can I use the constant 'now' in the table creation statements?

Will all three columns get assigned the same value at the start of each
record creation, or will I have some that might straddle a second
boundary and be one second apart?

How do I tell the 'now' constant to be to the second's place in
precision?


--

Carpe Dancem ;-)
-----------------------------------------------------------------
Remember your friends while they are alive
-----------------------------------------------------------------
                         Sincerely, Dennis Gearon

pgsql-general by date:

Previous
From: Nicolas Boretos
Date:
Subject: Re: postgres on a PDA
Next
From: Csaba Nagy
Date:
Subject: Re: three timestamps/table, use of 'now' in table creat