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

From Hunaid Sohail
Subject Re: [PATCH] Add roman support for to_number function
Date
Msg-id CAMWA6yYb0ucH+Bx6NqjGBFB8vHRhu7+w-RxooOPLOK5gKhc33A@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Add roman support for to_number function  (Aleksander Alekseev <aleksander@timescale.com>)
List pgsql-hackers


On Thu, Sep 5, 2024 at 2:41 PM Aleksander Alekseev <aleksander@timescale.com> wrote:

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
```

I also noticed there are no tests for to_char roman format. The test you provided covers roman format in both to_char and to_number. I will add it.
Thank you.

Regards,
Hunaid Sohail

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: per backend I/O statistics
Next
From: Peter Eisentraut
Date:
Subject: Re: strange context message in spi.c?