Hunaid Sohail <hunaidp...@gmail.com> writes: > I have attached a new patch v8 with the following changes: > 1. Fixed cases reported by Maciek. > 2. Handles leading spaces in input string.
I pushed this after fooling with it a bit more: * The way you did the leading-space skip would actually skip anything whatsoever until it found a valid roman character. I don't think that's what's wanted here. We just want to skip whitespace --- the idea more or less is to consume leading whitespace that to_char('RN') might have emitted. * You'd also re-introduced failure on trailing whitespace (or indeed trailing anything), which I still don't agree with. It's not appropriate for RN to dictate that nothing can follow it. There's a separate discussion to be had about whether to_number is too lax about trailing garbage, but the policy should not be different for RN than it is for other format codes. * I made some other cosmetic changes such as rearranging the error checks into an order that made more sense to me. Thanks for submitting this patch! regards, tom lane