RE: [SQL] 'now - 4 hours ago' ? - Mailing list pgsql-sql

From Jackson, DeJuan
Subject RE: [SQL] 'now - 4 hours ago' ?
Date
Msg-id F10BB1FAF801D111829B0060971D839F2E8C3F@cpsmail
Whole thread Raw
List pgsql-sql
> On Thu, 18 Jun 1998, Petter Reinholdtsen wrote:
>
> |  CREATE TABLE testdate(
> |       received timestamp DEFAULT CURRENT_DATE,
> |       info text NOT NULL
> |       );
>
> I think CURRENT_DATE will be parsed to the table creation's time.
> so better to use:
>
>     CREATE TABLE testdate (
>         received timestamp DEFAULT timestamp(now()),
>         info     text      NOT NULL
>         );
>
>     Redax
>
DATETIME has more features and a wider range than TIMESTAMP, so if I
were you that's what I'd be using.
try: SELECT NOW()::DATETIME - '@4 hours'::TIMESPAN;
I suggest sticking with DATETIME as much as you can.
        -DEJ

pgsql-sql by date:

Previous
From: Patrice Hédé
Date:
Subject: Re: [SQL] Internationalisation: SELECT str (ignoring Umlauts/Accents)
Next
From: Steve Doliov
Date:
Subject: (no subject)