double precision to numeric overflow error

From: Thomas O'Connell <tfo(at)monsterlabs(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: double precision to numeric overflow error
Date: 2003-01-07 23:12:08
Message-ID: tfo-DC0904.17120807012003@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-01-07 23:16:09 Re: [PERFORM] PostgreSQL and memory usage
Previous Message Dann Corbit 2003-01-07 23:10:06 Re: [HACKERS] I feel the need for speed. What am I doing wrong?

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2003-01-07 23:36:44 Re: [SQL] double precision to numeric overflow error
Previous Message Achilleus Mantzios 2003-01-07 22:51:35 Re: [SQL] [PERFORM] 7.3.1 index use / performance