pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedSYSDATE in PostgreSQL !?
3+ messages / 3 participants
[nested] [flat]
* SYSDATE in PostgreSQL !?
@ 2004-03-01 21:09 Louie Kwan <lkwan@nuvo.com>
2004-03-01 21:16 ` Re: SYSDATE in PostgreSQL !? Bjoern Metzdorf <bm@turtle-entertainment.de>
0 siblings, 1 reply; 3+ messages in thread
From: Louie Kwan @ 2004-03-01 21:09 UTC (permalink / raw)
To: pgsql-admin
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: SYSDATE in PostgreSQL !?
2004-03-01 21:09 SYSDATE in PostgreSQL !? Louie Kwan <lkwan@nuvo.com>
@ 2004-03-01 21:16 ` Bjoern Metzdorf <bm@turtle-entertainment.de>
2004-03-01 21:19 ` Re: SYSDATE in PostgreSQL !? scott.marlowe <scott.marlowe@ihs.com>
0 siblings, 1 reply; 3+ messages in thread
From: Bjoern Metzdorf @ 2004-03-01 21:16 UTC (permalink / raw)
To: Louie Kwan <lkwan@nuvo.com>; +Cc: pgsql-admin
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: SYSDATE in PostgreSQL !?
2004-03-01 21:09 SYSDATE in PostgreSQL !? Louie Kwan <lkwan@nuvo.com>
2004-03-01 21:16 ` Re: SYSDATE in PostgreSQL !? Bjoern Metzdorf <bm@turtle-entertainment.de>
@ 2004-03-01 21:19 ` scott.marlowe <scott.marlowe@ihs.com>
0 siblings, 0 replies; 3+ messages in thread
From: scott.marlowe @ 2004-03-01 21:19 UTC (permalink / raw)
To: Bjoern Metzdorf <bm@turtle-entertainment.de>; +Cc: Louie Kwan <lkwan@nuvo.com>; pgsql-admin
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.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-03-01 21:19 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-03-01 21:09 SYSDATE in PostgreSQL !? Louie Kwan <lkwan@nuvo.com>
2004-03-01 21:16 ` Bjoern Metzdorf <bm@turtle-entertainment.de>
2004-03-01 21:19 ` scott.marlowe <scott.marlowe@ihs.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox