Re: I was spoiled by the MySQL timestamp field

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: will trillich <will(at)serensoft(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: I was spoiled by the MySQL timestamp field
Date: 2003-01-24 12:11:12
Message-ID: 3E312D60.6FA506A8@cvc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What's the difference between 'now()' and 'current_timestamp' ?

will trillich wrote:
>
> On Fri, Jan 24, 2003 at 09:57:04AM +1300, Luke Pascoe wrote:
> > Why not just use a DEFAULT NOW()?
> > ie:
> > CREATE TABLE blah (
> > time TIMESTAMP NOT NULL DEFAULT NOW()
> > );
> >
> > I know it works for DATETIME types, don't know about TIMESTAMP
> > but I assume it would be the same.
>
> great for INSERT, but rather inert on UPDATE.
>
> create table _gribnif (
> created timestamp default current_timestamp,
> modified timestamp,
> other text,
> );
>
> create view gribnif ...
>
> create rule gribnif_edit as
> on update to gribnif
> do instead (
> update _gribnif set
> MODIFIED = CURRENT_TIMESTAMP,
> other = NEW.other
> where
> id = NEW.id
> ;
> );
>
> --
> There are 10 kinds of people:
> ones that get binary, and ones that don't.
>
> will(at)serensoft(dot)com
> http://sourceforge.net/projects/newbiedoc -- we need your brain!
> http://www.dontUthink.com/ -- your brain needs us!
>
> Looking for a firewall? Do you think smoothwall sucks? You're
> probably right... Try the folks at http://clarkconnect.org/ !
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--

Carpe Dancem ;-)
-----------------------------------------------------------------
Remember your friends while they are alive
-----------------------------------------------------------------
Sincerely, Dennis Gearon

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-01-24 12:24:54 Re: ORDER BY 'criteria'
Previous Message CN LIOU 2003-01-24 11:48:27 Re: Stable function Repeatedly Called