Re: a question about dates and timestamp - Mailing list pgsql-sql

From Karel Zak
Subject Re: a question about dates and timestamp
Date
Msg-id Pine.LNX.3.96.1000803122838.31239E-100000@ara.zf.jcu.cz
Whole thread Raw
In response to Re: a question about dates and timestamp  (Ange Michel POZZO <poange@technologist.com>)
List pgsql-sql
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?



pgsql-sql by date:

Previous
From: Ange Michel POZZO
Date:
Subject: Re: a question about dates and timestamp
Next
From: The Hermit Hacker
Date:
Subject: Re: What is happening?