Re: Allow to_date() and to_timestamp() to accept localized names

From: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allow to_date() and to_timestamp() to accept localized names
Date: 2019-08-23 08:33:22
Message-ID: CAC+AXB0x7juj7RVjMj0LV95=Uo=EgRJFmLFBbLRodObr4yJJag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 22, 2019 at 9:38 PM Juan José Santamaría Flecha
<juanjo(dot)santamaria(at)gmail(dot)com> wrote:
>
> >
> > Going through the current items in the wiki's todo list, I have been
> > looking into: "Allow to_date () and to_timestamp () to accept
> > localized month names".
> >
>
> I have gone through a second take on this, trying to give it a better
> shape but it would surely benefit from some review, so I will open an
> item in the commitfest.

For reviewers, the current aproach for this patch is:

Break seq_search() into two functions:
* seq_search_sqlascii() that supports seq_search() current usage.
* seq_search_localized() similar to the previous but supports multibyte input.
To avoid code duplication most of current seq_search() logic has been
moved to a new function str_compare().
from_char_seq_search() is now responsible to choose between
seq_search_sqlascii() or seq_search_localized().
Also, since localized names is not a null terminated array,
seq_search() now receives the dimension as input and terminating nulls
have been removed from static arrays.

The commitfest item is:

https://commitfest.postgresql.org/24/2255/

Regards,

Juan José Santamaría Flecha

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2019-08-23 08:44:01 Re: Comment in ginpostinglist.c doesn't match code
Previous Message Alexander Kukushkin 2019-08-23 08:05:02 Statement timeout in pg_rewind