pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: James Coleman <jtc331@gmail.com>
Cc: Juan José SantamarÃa Flecha <juanjo.santamaria@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Mark Dilger <mark.dilger@enterprisedb.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Arthur Zakirov <zaartur@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Allow to_date() and to_timestamp() to accept localized names
Date: Sun, 08 Mar 2020 12:38:59 -0400
Message-ID: <21675.1583685539@sss.pgh.pa.us> (raw )
In-Reply-To: <CAAaqYe-PJwDBw1HQApn3SR9SkorBvPGE5Wq9hA05BamtF8MX5Q@mail.gmail.com >
References: <20200124161814.GA8989@alvherre.pgsql >
<32487.1579882979@sss.pgh.pa.us >
<2f83150e-a2c0-6318-3125-d9b86e421aa2@2ndquadrant.com >
<964.1579884408@sss.pgh.pa.us >
<CAC+AXB1+dHo_DhCTySrqoVaq9WUta9uA+2Ens-bEqDw8X4UbTA@mail.gmail.com >
<ba83b5a7-e63e-5aaf-ac29-745a549f9d7d@2ndquadrant.com >
<aa5d8d96-0eb6-07b9-2caf-0910b313cb56@2ndquadrant.com >
<7212.1580177517@sss.pgh.pa.us >
<2E3D8D71-3B55-4735-A047-1FECE1506CD1@enterprisedb.com >
<d2b20ae0-a377-5edc-504b-80b1792a6bf0@2ndquadrant.com >
<6642.1580223087@sss.pgh.pa.us >
<4144A0A0-4820-458D-A105-D5EC0E0D133B@enterprisedb.com >
<CAC+AXB2uTOaPQ2cxvjgcGF3kRVCucftFwchZdQ5n_F0R+P7KwA@mail.gmail.com >
<dae3654e-aee2-b691-ec82-f8dc43ebfd14@2ndquadrant.com >
<CAC+AXB3ymGCsGaAwYjEZUZG3gK5UO6koSUz=v4Sp_qX6UtOOFQ@mail.gmail.com >
<16875.1583012185@sss.pgh.pa.us >
<6719.1583101530@sss.pgh.pa.us >
<CAC+AXB1oZ7mAavSLHEi0w-WUOAeQbN3hr25gG97253=YCY4aUA@mail.gmail.com >
<29169.1583251740@sss.pgh.pa.us >
<16113.1583634677@sss.pgh.pa.us >
<CAAaqYe8-PTBymp! zUioLE8xn_CeK4c16YKDq91CLD43kDDC98GQ@mail.gmail.com >
<16894.1583635679@sss.pgh.pa.us >
<CAC+AXB2VgaC65Y+GoWyjKZttfNJT4i8ums2DFtTcVqoi0wOyag@mail.gmail.com >
<CAAaqYe_BSpMomgv5mXvZezdBw9Kkz0JnB_FrisS8cQeBF8qgDA@mail.gmail.com >
<CAAaqYe-PJwDBw1HQApn3SR9SkorBvPGE5Wq9hA05BamtF8MX5Q@mail.gmail.com >
James Coleman <jtc331@gmail.com> writes:
> Since sudo dpkg-reconfigure locales opens up an ncurses gui on my machine,
> I tried selecting the tr_TR.ISO-8859-9 option there and removed the
> /var/lib/locales/supported.d/local file. Now I get:
> $ locale -a | grep tr_TR
> tr_TR
> tr_TR.iso88599
> tr_TR.utf8
> And now `make check` passes.
Hm.
> I'm still interested in understanding why we're using the ISO locale
> instead of the utf8 one in a utf8-labeled test though.
We are not. My understanding of the rules about this is that the
active LC_CTYPE setting determines the encoding that libc uses,
period. The encoding suffix on the locale name only makes a
difference when LC_CTYPE is being specified (or derived from LANG or
LC_ALL), not any other LC_XXX setting --- although for consistency
they'll let you include it in any LC_XXX value.
We could of course choose to spell LC_TIME as 'tr_TR.utf8' in this
test, but that would open up the question of whether that causes
problems on platforms where the canonical spelling of the encoding
suffix is different (eg "UTF-8"). I'm disinclined to take that risk
without positive proof that it helps on some platform.
My guess about what was actually happening on your machine is that
the underlying locale data only exists in iso-8859-9 form, and that
glibc normally translates that to utf8 on-the-fly when it's demanded
... but if the data isn't installed at all, nothing happens.
On my Red Hat platforms, this installation choice seems pretty
all-or-nothing, but it sounds like Debian lets you chop it up
more finely (and maybe slice off your finger while at it :-().
regards, tom lane
view thread (66+ messages) latest in thread
Message-ID: <21675.1583685539@sss.pgh.pa.us>
Permalink: ../21675.1583685539@sss.pgh.pa.us/
Also on: postgresql.org/message-id/21675.1583685539@sss.pgh.pa.us
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, jtc331@gmail.com, juanjo.santamaria@gmail.com, peter.eisentraut@2ndquadrant.com, mark.dilger@enterprisedb.com, alvherre@2ndquadrant.com, zaartur@gmail.com, tomas.vondra@2ndquadrant.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Allow to_date() and to_timestamp() to accept localized names
In-Reply-To: <21675.1583685539@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox