Search Postgresql Archives

Re: missing something obvious about intervals?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 12, 2005 at 13:04:05 -0500,
  Jim Buttafuoco <jim@xxxxxxxxxxxxxx> 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)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux