Hi, > I have attached a new patch v2 with following changes: > > - Handled invalid cases like 'viv', 'lxl', and 'dcd'. > - Changed errcode to 22P07 because 22P06 was already taken. > - Removed TODO. > - Added a few positive & negative tests. > - Updated documentation. > > Looking forward to your feedback.
While playing with the patch I noticed that to_char(..., 'RN') doesn't seem to be test-covered. I suggest adding the following test: ``` WITH rows AS ( SELECT i, to_char(i, 'FMRN') AS roman FROM generate_series(1, 3999) AS i ) SELECT bool_and(to_number(roman, 'RN') = i) FROM rows; bool_and ---------- t ``` ... in order to fix this while on it. The query takes ~12 ms on my laptop. -- Best regards, Aleksander Alekseev