Re: to_char/to_number loses sign
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-hackers@postgresql.org, Karel Zak <zakkr@zf.jcu.cz>
Date: 2004-10-23T21:25:52Z
Lists: pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> SELECT to_number('485-', '999S');
> to_number
> -----------
> 485
> Is this a bug or intentional?
Tracing through this, it looks like the problem is that NUM_processor()
has no switch case for NUM_S (nor does the default case raise an error,
which seems a risky practice to me).
Karel, can you verify this and submit a fix?
regards, tom lane