Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: FW: Re: Part 1 of several - Converting a varchar to an interval



 -------------- Original message ----------------------
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> aklaver(at)comcast(dot)net (Adrian Klaver) writes:
> > select ('134987'::int/1000.00) * interval ' 1 second' ;
> >     ?column?
> >  --------------
> >   00:02:14.987
> >  (1 row)
> 
> Or even easier:
> 
> regression=# select 134987 * interval '1 msec';
>    ?column?   
> --------------
>  00:02:14.987
> (1 row)
> 
> 
> 			regards, tom lane
> 

That's the secret, I tried '1 millisecond' . Should have dug further.
--
Adrian Klaver
aklaver(at)comcast(dot)net



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group