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

BUG #2866: cast varchar to decimal failure



The following bug has been logged online:

Bug reference:      2866
Logged by:          john lyssy
Email address:      jlyssy(at)missiontitle(dot)com
PostgreSQL version: 8.2
Operating system:   Windows XP
Description:        cast varchar to decimal failure
Details: 

This cast returns:ERROR: invalid input syntax for type numeric: ""
SQL state: 22P02

select string1 from adfields where
(cast (string1 as decimal (6,2)) >= 0.0) and (string1 != '' )

The cast works:
select string1 from adfields where
(string1 != '' ) and (cast (string1 as decimal (6,2)) >= 0.0)  


The only thing changed is the order of where clause expressions!

Note: string1 is a varchar (50) which i am casting to decimal... e.g.
character '0' is casted to decimal 0, etc...



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group