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: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Mark Dilger <mark.dilger@enterprisedb.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-03-01T22:25:30Z
Lists: pgsql-hackers
Attachments
- 0001-Allow-localized-month-names-to_date-v11.patch (text/x-diff) patch v11-0001
I wrote: > * I don't think it's appropriate to hard-wire DEFAULT_COLLATION_OID > as the collation to do case-folding with. For to_date/to_timestamp, > we have collatable text input so we can rely on the function's input > collation instead, at the cost of having to pass down the collation > OID through a few layers of subroutines :-(. For parse_datetime, > I punted for now and let it use DEFAULT_COLLATION_OID, because that's > currently only called by JSONB code that probably hasn't got a usable > input collation anyway (since jsonb isn't considered collatable). On closer look, it's probably a wise idea to change the signature of parse_datetime() to include a collation argument, because that function is new in v13 so there's no API-break argument against it. It will never be cheaper to change it than today. So v11 below does that, pushing the use of DEFAULT_COLLATION_OID into the json-specific code. Perhaps somebody else would like to look at whether there's something brighter for that code to do, but I still suspect there isn't, so I didn't chase it further. > Barring objections, this seems > committable to me. Going once, going twice ... regards, tom lane
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