Re: to_char/to_number loses sign

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Subject: Re: to_char/to_number loses sign
Date: 2004-10-23 21:25:52
Message-ID: 27578.1098566752@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gaetano Mendola 2004-10-23 22:08:22 Re: Question on the 8.0Beta Version
Previous Message Steve Crawford 2004-10-23 21:16:34 Re: Time off

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2004-10-24 08:27:20 Re: hash_create(): check return code
Previous Message Nicolai Tufar 2004-10-23 17:01:21 (Turkish) New translation: psql