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

I just tried this  and got the following which is also what I got when using 'millisecond'

Select 134987 * interval '1 msec';
ERROR:  invalid input syntax for type interval: "1 msec"

SELECT version();
                                            version
------------------------------------------------------------------------------------------------
 PostgreSQL 8.2.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

--
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