On Thu, 3 Aug 2000, Ange Michel POZZO wrote:
> Le jeu, 03 aoű 2000, Karel Zak a écrit :
> > > my question is how can i convert the numeric or the int4 value to
> > > a date value?
> >
> >
> > test=# select abstime(965293003);
> > abstime
> > ------------------------
> > 2000-08-03 10:56:43+02
> > (1 row)
> >
> > Karel
>
>
> this is the result of the query for me :
>
> test=> select abstime(965293003);
> ?column?
> ---------
> 965293003
> (1 row)
Ooops I use CVS version, but you have probably 6.5...
Sorry, Now I haven't time check what is 7.1 / 7.0 / 6.5 feature.
in current code:
test=# select '965293003.000001'::int;
ERROR: pg_atoi: error in "965293003.000001": can't parse ".000001"
test=# select '965293003.000001'::numeric(9, 0);
?column?
-----------
965293003
(1 row)
test=# select '965293003.000001'::numeric(9, 0)::int;
?column?
-----------
965293003
(1 row)
test=# select abstime('965293003.000001'::numeric(9, 0)::int);
abstime
------------------------
2000-08-03 10:56:43+02
(1 row)
BTW. The postgreSQL has good date/time support; why you use slow and
expensive numeric?