Re: [QUESTIONS] select date('now'::datetime+'30 day'::timespan)

From: Brett McCormick <brett(at)abraxas(dot)scene(dot)com>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: pgsql-questions(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [QUESTIONS] select date('now'::datetime+'30 day'::timespan)
Date: 1998-01-28 00:03:42
Message-ID: 199801280003.QAA11790@abraxas.scene.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I was just using 30 days because that's what the previous fellow used..
it works, but some of the time conversion routines are still messed up.

select date('now'::datetime),date(datetime(date('now'::datetime)));
date| date
----------+----------
01-27-1998|01-26-1998
(1 row)

those should be the same correct? it appears to get messed up in the
datetime(date) conversion..

--brett

On Tue, 27 January 1998, at 08:21:22, Thomas G. Lockhart wrote:

> btw, if you want to add a month, better to use
>
> postgres=> select date( cast 'now'::date as datetime + '1
> month'::timespan);
> date
> ----------
> 02-27-1998
> (1 row)
>
> (The important thing is the '1 month' time span; ignore the casting
> until v6.3 :)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-01-28 02:30:53 deadlocks
Previous Message Brett McCormick 1998-01-27 23:57:00 Re: [HACKERS] A small type extension example for the contrib directory (fwd)