Re: [PATCH] Add roman support for to_number function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Add roman support for to_number function
Date
Msg-id 4072617.1737577744@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Add roman support for to_number function  (Maciek Sakrejda <m.sakrejda@gmail.com>)
List pgsql-hackers
Hunaid Sohail <hunaidpgml@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



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Issue with markers in isolation tester? Or not?
Next
From: Tomas Vondra
Date:
Subject: Re: Proposal: "query_work_mem" GUC, to distribute working memory to the query's individual operators