double precision to numeric overflow error

Thomas F.O'Connell <tfo@monsterlabs.com>

From: Thomas O'Connell <tfo@monsterlabs.com>
To: pgsql-general@postgresql.org, pgsql-sql@postgresql.org
Date: 2003-01-07T23:12:08Z
Lists: pgsql-general
is this expected behavior? if so, then why?

-tfo

db=# create table foo( col timestamp );
db=# select cast( extract( epoch from col ) as numeric( 15, 6 ) ) from 
foo;
 date_part 
-----------
(0 rows)
db=# insert into foo values( current_timestamp );
INSERT 1705954 1
db=# select cast( extract( epoch from col ) as numeric( 15, 6 ) ) from 
foo;
ERROR:  overflow on numeric ABS(value) >= 10^9 for field with precision 
15 scale 6