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: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Arthur Zakirov <zaartur(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allow to_date() and to_timestamp() to accept localized names
Date: 2020-01-24 17:25:11
Message-ID: CAC+AXB1+dHo_DhCTySrqoVaq9WUta9uA+2Ens-bEqDw8X4UbTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 24, 2020 at 5:46 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> > Looking through the patch quickly, if you want to get Unicode-fancy,
> > doing a case-insensitive comparison by running lower-case on both
> > strings is also wrong in corner cases. All the Greek month names end in
> > sigma, so I suspect that this patch might not work correctly in such
> cases.
>
> Hm. That's basically what citext does, and I don't recall hearing
> complaints about that. What other definition of "case insensitive"
> would you suggest?
>
>
To illustrate the issue, it does not work as expected:

postgres=# select lower(to_char(now(),'TMMONTH'));
lower
------------
ιανουάριοσ
(1 row)

postgres=# select to_char(now(),'TMmonth');
to_char
------------
ιανουάριος
(1 row)

Regards,

Juan José Santamaría Flecha

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Xiang Xiao 2020-01-24 17:38:45 any work item suggestion for newbie?
Previous Message Mark Dilger 2020-01-24 17:14:34 Re: making the backend's json parser work in frontend code