Discussion:
SYSDATE in PostgreSQL !?
(too old to reply)
Louie Kwan
2004-03-01 21:09:24 UTC
Permalink
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


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
Bjoern Metzdorf
2004-03-01 21:16:28 UTC
Permalink
Post by Louie Kwan
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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html
scott.marlowe
2004-03-01 21:19:17 UTC
Permalink
Post by Bjoern Metzdorf
Post by Louie Kwan
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.


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Loading...