Re: missing something obvious about intervals? - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: missing something obvious about intervals?
Date
Msg-id 20051212183445.GA4492@wolff.to
Whole thread Raw
In response to Re: missing something obvious about intervals?  ("Jim Buttafuoco" <jim@contactbda.com>)
List pgsql-general
On Mon, Dec 12, 2005 at 13:04:05 -0500,
  Jim Buttafuoco <jim@contactbda.com> wrote:
>
> try
>
>
> select '2005-12-01'::date + (456.5::float || ' seconds')::interval;
>         ?column?
> ------------------------
>  2005-12-01 00:07:36.50
> (1 row)

You are better off doing a multiply. Something like:
area=> select '2005-12-01'::date + 456.5 * '1 second'::interval;
        ?column?
------------------------
 2005-12-01 00:07:36.50
(1 row)

pgsql-general by date:

Previous
From: Volkan YAZICI
Date:
Subject: Re: missing something obvious about intervals?
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Free Pascal and Postgresql Functions, Possible?