Laurent Martelli wrote:
> to_number('123.0','999999') returns 1230, at least on version 7.4 and 8.1. I
> think it should return 123 or raise an error.
to_number will silently ignore any character that doesn't match the
pattern. That can be confusing, and not generally a very bright idea in
applications, but we can't really change the behavior because that could
break existing applications.
You can use the pattern '999999.' to get the behavior you want (returns
123).
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com