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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Arthur Zakirov <zaartur@gmail.com>, Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-01-23T17:53:16Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Even whitespace is problematic for some languages, such as Afan,

> mon      "Qunxa Garablu";/
>          "Naharsi Kudo";/
>          "Ciggilta Kudo";/

> (etc) but I think whitespace-splitting is going to be more comprehensible
> in the vast majority of cases, even if not perfect.

Interesting.  Given that to_date et al are often willing to ignore
whitespace in input, I wonder whether we won't have some other issues
with names like that --- not so much that basic cases wouldn't work,
as that people might reasonably expect that, say, we'd be flexible
about the amount of whitespace.  Seems like a problem for another day
though.

In the meantime, I agree that "truncate at whitespace" is a better
heuristic for the error messages than what we've got.  I'll go make it so.

			regards, tom lane



Commits

  1. Allow to_date/to_timestamp to recognize non-English month/day names.

  2. Clean up formatting.c's logic for matching constant strings.

  3. Implement standard datetime parsing mode

  4. Repair assorted issues in locale data extraction.