Re: SYSDATE in PostgreSQL !? - Mailing list pgsql-sql

From Oliver Elphick
Subject Re: SYSDATE in PostgreSQL !?
Date
Msg-id 1078181848.2603.23.camel@cerberus.lfix.co.uk
Whole thread Raw
In response to SYSDATE in PostgreSQL !?  (Louie Kwan <lkwan@nuvo.com>)
List pgsql-sql
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().




pgsql-sql by date:

Previous
From: Manuel Sugawara
Date:
Subject: Re: select by groups
Next
From: Terence Kearns
Date:
Subject: Re: returning a recordset from PLpg/SQL