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 1lihWF-00048N-Lo for pgsql-docs@arkaria.postgresql.org; Mon, 17 May 2021 17:59: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 1lihWE-0000EA-14 for pgsql-docs@arkaria.postgresql.org; Mon, 17 May 2021 17:59:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lihWD-0000Du-37 for pgsql-docs@lists.postgresql.org; Mon, 17 May 2021 17:59:05 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lihW9-0004Fp-Qm for pgsql-docs@lists.postgresql.org; Mon, 17 May 2021 17:59:03 +0000 Received: by mail-pf1-x436.google.com with SMTP id d16so5475194pfn.12 for ; Mon, 17 May 2021 10:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yugabyte.com; s=google; h=from:mime-version:subject:message-id:date:to; bh=xsm9pGKsldP7ARbdcX3+DB97oRGbfdb3pBBnEf1mqtI=; b=YdVuH37BnaE9f0vDVUvKtCoA+q93e07s6mjZDNG8Y3WKg9ojFEPsi8QnOqm3b77Gka 9TH4vwPXm1oJot6hP+8vlkPnUz9Vya/pS4rTWGLAmtA/dU8MHqGaLQQ3Wk6PktjlOj+3 q0K3ytoZDTPEic9nspUzwyN0/hPP6qN9f4QZ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=xsm9pGKsldP7ARbdcX3+DB97oRGbfdb3pBBnEf1mqtI=; b=Ck2u/iRlK0da+eCUPEHeA/j7itpLyKMJNvSt5diXThmHr38SVZlc5xny1iBL8TmAga wdjeoVaEy360XZrm3WkCLXZ8HbXR6zvyNR/OnlNlc2In4cMjVSw/HyQ9CytZ16vMNujZ rI10XsdCy3RatsAe1gh/bV7tbzW9X4wI50iiw5uq2vIYmcECeYKfTJugwpdOXu+L4Mr8 Zv6drvld0ZpZVKs8CDyTlSo1kvTKNx5CM4jlgHJnhTVVBTE2iS6+JAZYZtHBxfuxADOQ RXgQNOvQuP4lYnsLNiI3zuIN78QMzkiOVYRtG07Bf7y9BP9BaNiyRdKoFQJ+QcZJy8Fa hmTw== X-Gm-Message-State: AOAM532ePffpnnC/21g3nfV8F8FSy8D0pWsvJDH1G2QhklifT2TE0YLR wy7dHdC1STQzilkxUW0pjbBf7C3Y796YOA== X-Google-Smtp-Source: ABdhPJx4PXlqty5bD9iMSmjW2ZHhKsgpIditLKYXf8+Iye7KlxWgmtCkkw9jBgGMo1WH7KqNIMAQcw== X-Received: by 2002:a63:5963:: with SMTP id j35mr701057pgm.281.1621274340058; Mon, 17 May 2021 10:59:00 -0700 (PDT) Received: from smtpclient.apple ([2601:646:101:7fda:7c8b:7383:7dd0:526f]) by smtp.gmail.com with ESMTPSA id w74sm278026pfd.209.2021.05.17.10.58.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 May 2021 10:58:59 -0700 (PDT) From: Bryn Llewellyn Content-Type: multipart/alternative; boundary="Apple-Mail=_64438B58-2C09-447D-B735-ED55FE77A67B" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Subject: Where are the legal values for LC_TIME listed? Message-Id: Date: Mon, 17 May 2021 10:58:58 -0700 To: Pg Docs 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=_64438B58-2C09-447D-B735-ED55FE77A67B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 It=E2=80=99s easy to guess values for, say, countries in Europe: This: create function to_char_demo() returns table(z text) language plpgsql as $body$ declare -- Counted from midnight 1-Jan-1970 UTC. secs constant double precision not null :=3D 94996756799.456789; t constant timestamp not null :=3D to_timestamp(-secs) at = time zone 'UTC'; fmt_1 constant text not null :=3D 'TMDay / TMMonth'; fmt_2 constant text not null :=3D 'TMDy dd-TMMon-yyyy = hh24:mi:ss.us BC'; begin set lc_time =3D 'en_US'; z :=3D to_char(t, fmt_1); return next; z :=3D to_char(t, fmt_2); return next; z :=3D ''; return next; set lc_time =3D 'it_IT'; z :=3D to_char(t, fmt_1); return next; z :=3D to_char(t, fmt_2); return next; z :=3D ''; return next; set lc_time =3D 'fi_FI'; z :=3D to_char(t, fmt_1); return next; z :=3D to_char(t, fmt_2); return next; end; $body$; select z from to_char_demo(); =E2=80=A6brings this result: Monday / September Mon 03-Sep-1042 12:00:00.543216 BC =20 Luned=C3=AC / Settembre Lun 03-Set-1042 12:00:00.543216 BC =20 Maanantai / Syyskuu Ma 03-Syy-1042 12:00:00.543216 BC But what do I use for, say, Simplified Chinese? Nothing that I guess = works. And, unlike is the case with =E2=80=9Cset IntervalStyle=E2=80=9D, = a bad value doesn=E2=80=99t bring a hint (or a doc ref) that gives the = LoV. The obvious search (LC_TIME in the search box of the PG doc for the = current version) gets no useful hits. Nor does this: = https://www.google.com/search?client=3Dsafari&rls=3Den&q=3DLC_TIME+site:ht= tps://www.postgresql.org/docs/13/&ie=3DUTF-8&oe=3DUTF-8 = --Apple-Mail=_64438B58-2C09-447D-B735-ED55FE77A67B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
It=E2=80=99s easy to guess values for, say, countries in = Europe:

This:

create function to_char_demo()
  returns table(z text)
  language plpgsql
as $body$
declare
  -- Counted from midnight = 1-Jan-1970 UTC.
  secs   constant = double precision not null :=3D 94996756799.456789;
  t      constant = timestamp        not null :=3D = to_timestamp(-secs) at time zone 'UTC';
  fmt_1  constant text     =         not null :=3D 'TMDay / TMMonth';
  fmt_2  constant text     =         not null :=3D 'TMDy dd-TMMon-yyyy = hh24:mi:ss.us BC';
begin
  set lc_time =3D 'en_US';
  z :=3D to_char(t, fmt_1);     =       return next;
  z :=3D = to_char(t, fmt_2);           return = next;
  z :=3D '';        =                 =   return next;

  set = lc_time =3D 'it_IT';
  z :=3D to_char(t, = fmt_1);           return next;
  z :=3D to_char(t, fmt_2);     =       return next;
  z :=3D = '';                    =       return next;

  set lc_time =3D 'fi_FI';
  z :=3D to_char(t, fmt_1);     =       return next;
  z :=3D = to_char(t, fmt_2);           return = next;
end;
$body$;

select z from to_char_demo();

=E2=80=A6brings this = result:

 Monday / = September
 Mon 03-Sep-1042 12:00:00.543216 BC
 
 Luned=C3=AC / Settembre
 Lun 03-Set-1042 12:00:00.543216 BC
 
 Maanantai / Syyskuu
 Ma 03-Syy-1042 12:00:00.543216 BC

But what do I use for, = say, Simplified Chinese? Nothing that I guess works. And, unlike is the = case with =E2=80=9Cset IntervalStyle=E2=80=9D, a bad value = doesn=E2=80=99t bring a hint (or a doc ref) that gives the = LoV.

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


= --Apple-Mail=_64438B58-2C09-447D-B735-ED55FE77A67B--