Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs - Mailing list pgsql-sql

From Byron Nikolaidis
Subject Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs
Date
Msg-id 357ED903.265DF2DA@insightdist.com
Whole thread Raw
Responses Re: [SQL] Re: [INTERFACES] Re: M$-Access'97 and TIMESTAMPs  ("Jose' Soares Da Silva" <sferac@bo.nettuno.it>)
List pgsql-sql

Krasnow, Greg wrote:

> I haven't looked at DATETIME stuff, but does Postgres not have something
> similar to Oracle's SYSDATE?  In Oracle you can set an Oracle DATE column to
> have a default of SYSDATE.  This way Oracle can fill in the column at the
> time an insert is done.
>

Yes, you are right, and I noticed Jose' earlier mail about this on the 'sql'
list.

If you do:

create table x (a timestamp DEFAULT CURRENT_TIMESTAMP, b varchar);

It works AND it puts in the current time at INSERT of the new row.  (I noticed
if you use CURRENT_TIME instead, you get the time you created the table at, for
every row, which is not very useful.)

The only problem is that it doesn't change the value on an UPDATE!

Any thoughts?

Byron


pgsql-sql by date:

Previous
From: Herouth Maoz
Date:
Subject: RE: [SQL] Problems with default date 'now'
Next
From: lynch@lscorp.com (Richard Lynch)
Date:
Subject: insert/select returned table