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

From: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(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-28 03:05:48
Message-ID: 2E3D8D71-3B55-4735-A047-1FECE1506CD1@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Jan 27, 2020, at 6:11 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> and I think it
> makes German better (does 'ß' appear in any month/day names there?),
> so maybe we should just roll with that.

To my knowledge, neither /ß/ nor /ss/ occur in day or month names in German, neither presently nor in recent times, so I wouldn’t expect it to matter for German whether you use uppercase or lowercase.

>
> The other question your example raises is whether we should be trying
> to de-accent before comparison, ie was it right for 'Ιανουάριος' to
> be treated differently from 'Ιανουαριος'. I don't know enough Greek
> to say, but it kind of feels like that should be outside to_date's
> purview.

I’m getting a little lost here. German uses both Sonnabend and Samstag for Saturday, so don’t you have to compare to a list of values anyway? I don’t know Norwegian, but Wikipedia shows both sundag and søndag for Sunday in Norwegian Nynorsk. Faroese seems to have a few similar cases. Whether those languages have alternate day names both in common usage, I can’t say, but both Sonnabend and Samstag are still in use in the German speaking world. If you need to compare against lists, then I would think you could put both ιανουάριοσ and ιανουάριος into a list, even if only one of them is grammatically correct Greek. I’d think that unaccented versions of names might also go into the list, depending on whether speakers of that language consider them equivalent. That sounds like something for the translators to hash out.


Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-01-28 03:26:15 Re: [HACKERS] Block level parallel vacuum
Previous Message Tom Lane 2020-01-28 02:57:57 Re: The flinfo->fn_extra question, from me this time.