Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liidv-0006M2-LU for pgsql-docs@arkaria.postgresql.org; Mon, 17 May 2021 19:11:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1liidt-0000pe-MH for pgsql-docs@arkaria.postgresql.org; Mon, 17 May 2021 19:11:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liidt-0000pU-DE for pgsql-docs@lists.postgresql.org; Mon, 17 May 2021 19:11:05 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1liidm-0006sa-Ap for pgsql-docs@lists.postgresql.org; Mon, 17 May 2021 19:11:04 +0000 Received: by mail-pf1-x42f.google.com with SMTP id b13so1891667pfv.4 for ; Mon, 17 May 2021 12:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yugabyte.com; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=cYRqnmjeGeJUokPvBTjVVJdI3Ayz/8GvuuUPHafzu3Q=; b=AQLuWPxWOhr/1dnukBBmPFXPL/FtSvrN5PN2iExl2XNryOE9Nk9sgD0DUu5Xw+b1iF kGWN0rFR4HstVCc9QHZGE1fI6uSk+42y/eZ5e4YSXXOZ92KBQOK69X5v6yEEIGL81wOu sFb0q2nI5zCnSzix2LTfZ3yM9StmmLGJeA4vA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=cYRqnmjeGeJUokPvBTjVVJdI3Ayz/8GvuuUPHafzu3Q=; b=PQUCi1/EuOAiUfJPSO21IW+65HePjuN1VyzSFmHm8wb4Brt1bvXcDPBbeJRgiYcuaO JDdAR9u1XPpvR1iE2RFgehyb0BTXgIhpkC0KcLznl7w1/87pxvTP6V7UiiyDCQjCsGoB Dd8mmM5PKEYOzNcuuN4mRz3lljTwYptV/7cvquGZ64o8MAJBCQmoqnMRcFjv0WZzl40w 6uYDGyBDdEQFHqvN37zxiwqyWkRQuFh6aHDabjW5qKaP7Dj4X64MQQU/8Vbxar5lLYvp MbefQ+Ck+P3Vg69q+5kBQzSYTSr2UIljZkdiAcpX570qvARl+NIiihWYV4fdzb/fIBDO vb2Q== X-Gm-Message-State: AOAM530jtRbJtmHzjMhIhoB5tRtWtrAZr/iYA8UUSbjlk8dJbZotXaEd mY1/UCMTZJkJFSGiOYCHALz9mw== X-Google-Smtp-Source: ABdhPJwzq4UKIyJI5j2qsG63FnFNuQ0KBe/FjS4wjPvJ8fqbLSojS6/sbKzTnW1AV+ndwmRMCaG/4w== X-Received: by 2002:aa7:8194:0:b029:2aa:db3a:4c1d with SMTP id g20-20020aa781940000b02902aadb3a4c1dmr1080252pfi.58.1621278655348; Mon, 17 May 2021 12:10:55 -0700 (PDT) Received: from smtpclient.apple ([2601:646:101:7fda:7c8b:7383:7dd0:526f]) by smtp.gmail.com with ESMTPSA id mj6sm1931612pjb.8.2021.05.17.12.10.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 May 2021 12:10:54 -0700 (PDT) From: Bryn Llewellyn Message-Id: <0231FAB9-2B88-4DEA-8462-E8ABEF6BE258@yugabyte.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_21783B65-A135-4CE3-94B5-DC2ADACD2B96" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Subject: Re: Where are the legal values for LC_TIME listed? Date: Mon, 17 May 2021 12:10:53 -0700 In-Reply-To: <2820595.1621274971@sss.pgh.pa.us> Cc: Pg Docs To: Tom Lane PostgreSQL References: <2820595.1621274971@sss.pgh.pa.us> X-Mailer: Apple Mail (2.3654.80.0.2.43) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_21783B65-A135-4CE3-94B5-DC2ADACD2B96 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 tgl@sss.pgh.pa.us wrote: > Bryn wrote: >=20 >> It=E2=80=99s easy to guess values for, say, countries in Europe: >=20 > On Unix-ish systems, "locale -a" should provide the set of available = values. We don't attempt to document this because it's so = installation-dependent. >=20 >> But what do I use for, say, Simplified Chinese? >=20 > Maybe you don't have a suitable locale installed. >=20 >> The obvious search (LC_TIME in the search box of the PG doc for the = current version) gets no useful hits. >=20 > The main entry for lc_time in >=20 > 19.11.2. Locale and Formatting: = https://www.postgresql.org/docs/current/runtime-config-client.html#RUNTIME= -CONFIG-CLIENT-FORMAT=20 >=20 > says =E2=80=9CAcceptable values are system-dependent; see Section 23.1 = for more information", and if you follow that link, you'll read >=20 > What locales are available on your system under what names depends = on what was provided by the operating system vendor and what was > installed. On most Unix systems, the command `locale -a` will = provide a list of available locales. >=20 > Not sure what more we could say. Thanks for the quick reply, Tom. `locale -a` showed that I do have a = suitable locale installed. When I add an extra paragraph to my code that = starts with `set lc_time =3D 'zh_CN=E2=80=99;`, I get this: =E6=98=9F=E6=9C=9F=E4=B8=80 / =E4=B9=9D=E6=9C=88 =E4=B8=80 03- 9-1042 12:00:00.543216 BC What looks like an m-dash is actually the Chinese character for = =E2=80=9Cone=E2=80=9D as in =E2=80=9C=E6=98=9F=E6=9C=9F=E4=B8=80=E2=80=9D = (lit. =E2=80=9Cweek-one=E2=80=9D which is the convention they adopted = when they adopted the Western Calendar). Had I picked Friday = (=E2=80=9C=E6=98=9F=E6=9C=9F=E4=BA=94=E2=80=9D) the output would have = been nicer. About =E2=80=9C Not sure what more we could say=E2=80=9D, no=E2=80=A6 I = don=E2=80=99t suppose there=E2=80=99s a cost-effective next step. In an = ideal world, you=E2=80=99d have O/S-dependent code that reads the output = of `locale -a`, sanitizes it to get the legal arguments for `set = lc_time`, and presents it as a relation. My problem is that doc search only gets me so far. Then I have to read = each whole page from top to bottom to find the nuggets=E2=80=94in this = case =E2=80=9C Acceptable values are system-dependent=E2=80=9D. --Apple-Mail=_21783B65-A135-4CE3-94B5-DC2ADACD2B96 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
tgl@sss.pgh.pa.us wrote:

Bryn wrote:

It=E2=80=99= s easy to guess values for, say, countries in Europe:

On Unix-ish systems, "locale -a" = should provide the set of available values.  We don't attempt = to document this because it's so installation-dependent.

But what = do I use for, say, Simplified Chinese?

Maybe you don't have a suitable locale installed.

The = obvious search (LC_TIME in the search box of the PG doc for the current = version) gets no useful hits.

The main entry for lc_time in

19.11.2. Locale = and Formatting: https://www.postgresql.org/docs/current/runtime-config-client.h= tml#RUNTIME-CONFIG-CLIENT-FORMAT 

says =E2=80=9CAcceptable values are = system-dependent; see Section 23.1 for more information", and if = you follow that link, you'll read

=    What locales are available on your system under what = names depends on what was provided by the operating system vendor = and what was
   installed. On most Unix = systems, the command `locale -a` will provide a list of available = locales.

Not sure what more we could = say.

Thanks for the quick reply, = Tom. `locale -a` showed that I do have a suitable locale installed. = When I add an extra paragraph to my code that starts with `set lc_time =3D= 'zh_CN=E2=80=99;`, I get this:

 =E6=98=9F=E6=9C=9F=E4=B8=80 / =E4=B9=9D=E6=9C=88
 =E4=B8=80 03- 9-1042 12:00:00.543216 BC

What = looks like an m-dash is actually the Chinese character for =E2=80=9Cone=E2= =80=9D as in =E2=80=9C=E6=98=9F=E6=9C=9F=E4=B8=80=E2=80=9D (lit. = =E2=80=9Cweek-one=E2=80=9D which is the convention they adopted when = they adopted the Western Calendar). Had I picked Friday (=E2=80=9C=E6=98=9F=E6=9C=9F=E4=BA=94=E2=80=9D) the = output would have been nicer.

About =E2=80=9C Not sure what more we = could say=E2=80=9D, no=E2=80=A6 I don=E2=80=99t suppose there=E2=80=99s = a cost-effective next step. In an ideal world, you=E2=80=99d have = O/S-dependent code that reads the output of `locale -a`, sanitizes it to = get the legal arguments for `set lc_time`, and presents it as a = relation.

My = problem is that doc search only gets me so far. Then I have to read each = whole page from top to bottom to find the nuggets=E2=80=94in this case = =E2=80=9C Acceptable values are system-dependent=E2=80=9D.



= --Apple-Mail=_21783B65-A135-4CE3-94B5-DC2ADACD2B96--