Thread: SYSDATE in PostgreSQL !?

SYSDATE in PostgreSQL !?

From
Louie Kwan
Date:
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 ?

Any help is appreciated.


CREATE TABLE channels    (
 channelID                  NUMBER PRIMARY KEY,
 name                         VARCHAR2(64) NOT NULL,
 status                        INTEGER NOT NULL,
 remedyID                   VARCHAR2(15) UNIQUE,
 remedySchemaID       NUMBER default 48,
 remedyLastModified    INTEGER,
 updateTimeStamp      DATE default (SYSDATE),
 createTimeStamp       DATE default (SYSDATE)
);


Regards,
Louie Kwan


Re: SYSDATE in PostgreSQL !?

From
Bjoern Metzdorf
Date:
Louie Kwan wrote:

> If there is no SYSDATE defined in PostgreSQL , what can I do ?
 >
 > createTimeStamp       DATE default (SYSDATE)

Perhaps NOW() ist what you are looking for?

createTimeStamp       DATE default 'NOW()'

Regards,
Bjoern

Re: SYSDATE in PostgreSQL !?

From
"scott.marlowe"
Date:
On Mon, 1 Mar 2004, Bjoern Metzdorf wrote:

> Louie Kwan wrote:
>
> > If there is no SYSDATE defined in PostgreSQL , what can I do ?
>  >
>  > createTimeStamp       DATE default (SYSDATE)
>
> Perhaps NOW() ist what you are looking for?
>
> createTimeStamp       DATE default 'NOW()'

I don't think you want the quotes around now(), otherwise it will always
insert the same date / time each time.