Re: Allow to_date() and to_timestamp() to accept localized names
Mark Dilger <mark.dilger@enterprisedb.com>
From: Mark Dilger <mark.dilger@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Arthur Zakirov <zaartur@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-01-28T03:05:48Z
Lists: pgsql-hackers
> On Jan 27, 2020, at 6:11 PM, Tom Lane <tgl@sss.pgh.pa.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
Commits
-
Allow to_date/to_timestamp to recognize non-English month/day names.
- d67755049388 13.0 landed
-
Clean up formatting.c's logic for matching constant strings.
- fb12aefaafce 11.7 landed
- be13f227febc 12.2 landed
- a576f2a8f2e8 9.5.21 landed
- 9e24575f6f1b 9.6.17 landed
- 600b953d73ca 9.4.26 landed
- 212b870d6743 10.12 landed
- 4c70098ffa8c 13.0 landed
-
Implement standard datetime parsing mode
- 1a950f37d0a2 13.0 cited
-
Repair assorted issues in locale data extraction.
- 7ad1cd31bfcb 12.0 cited