On Mon, 2004-03-01 at 21:18, Louie Kwan wrote:
> How can I define a table with columns with sysdate as the default value..
>
> If there is no SYSDATE defined in PostgreSQL , what can I do ?
> CREATE TABLE channels (
...
> updateTimeStamp DATE default (SYSDATE),
> createTimeStamp DATE default (SYSDATE)
> );
updateTimeStamp DATE DEFAULT CURRENT_DATE
or possibly
updateTimeStamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
which will give you time as well as date. Perhaps you should also add
NOT NULL.
CURRENT_* doesn't change within a transaction. If you need to record
real time, use timeofday().