pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jackson, DeJuan <djackson@cpsgroup.com>
To: Zsolt Varga <redax@agria.hu>
To: Petter Reinholdtsen <pere@hungry.com>
Cc: pgsql-sql@postgreSQL.org
Subject: RE: [SQL] 'now - 4 hours ago' ?
Date: Fri, 19 Jun 1998 12:22:01 -0500
Message-ID: <F10BB1FAF801D111829B0060971D839F2E8C3F@cpsmail> (raw)

> 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



view thread (3+ messages)

Message-ID: <F10BB1FAF801D111829B0060971D839F2E8C3F@cpsmail>
Permalink:  ../F10BB1FAF801D111829B0060971D839F2E8C3F@cpsmail/
Also on:    postgresql.org/message-id/F10BB1FAF801D111829B0060971D839F2E8C3F@cpsmail

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: djackson@cpsgroup.com, redax@agria.hu, pere@hungry.com
  Subject: Re: [SQL] 'now - 4 hours ago' ?
  In-Reply-To: <F10BB1FAF801D111829B0060971D839F2E8C3F@cpsmail>
  References: <F10BB1FAF801D111829B0060971D839F2E8C3F@cpsmail>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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