Thread: automatic timestamp

automatic timestamp

From
Marc Tardif
Date:
Does postgresql have an automatic timestamp, something built-in which
could save me from creating an extra date field? This kind of information
could be used to delete records which have become too old. If there is
such a hidden field, please let me know whereabout in the manual I could
read more about it.

Thanks,
Marc


Re: [GENERAL] automatic timestamp

From
Sevo Stille
Date:
Marc Tardif wrote:
>
> Does postgresql have an automatic timestamp, something built-in which
> could save me from creating an extra date field?

Time travel implied something like that, but that was tied to pg_time,
which is gone now, and, being a log rather than a table, was not
accessible from userland, AFAIR.

However, while you have to create an extra timestamp field for it, it is
trivial to have that field run along without ever maintaining it
actively - give it a DEFAULT CURRENT_TIMESTAMP, and make sure that it is
the last in the table, so that you can insert values().

Sevo


--
Sevo Stille
sevo@ip23.net