Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iv3HF-0000nQ-7k for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jan 2020 18:01:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iv3HD-0004HZ-2U for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Jan 2020 18:01:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iv3HC-0004HQ-Mf for pgsql-hackers@lists.postgresql.org; Fri, 24 Jan 2020 18:01:50 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iv3H9-0008Fk-A2 for pgsql-hackers@lists.postgresql.org; Fri, 24 Jan 2020 18:01:49 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 627814A4; Fri, 24 Jan 2020 13:01:44 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 24 Jan 2020 13:01:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=6C4stjTwXiEM5BOWGUZieEsx+G5K0dEs5DHF6qOdX vI=; b=w3qpiL/+T9a2/9nTFVig0/3dT8fYxmxYHiaLB/87UD9dVwAnyVufCuY0S qLUqZ9YkZmmiywKCDedK4W5Siyd7h0VfGpC0ULPo5j2XS9BnUJXJH2AlpNo/bVLH jHMz4kv39oQDkd1a622AVnECOBnMPQ4MrlOOVVF3x/NFLWE2tcDguNRxzTl6leQf 4nU1irg4SRe0rPDKa7dxgppMN8orAcMx5Uccz7F31+63E0ILvNOKQF5x+SnrjW0L +/RpFG0TVkCSjBv6MHLNzSHyMJvRKqkDCPYAkcS9wbC49BMZcitW0reVGKGTZINn XJO7AlAp58dXkjk2J9swsq2xQhC+Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrvdeggddutdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhohfkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnug hquhgrughrrghnthdrtghomheqnecuffhomhgrihhnpedvnhguqhhurggurhgrnhhtrdgt ohhmnecukfhppeelfedrvdegvddrvdehhedrudduvdenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vdhnughquhgrughrrghnthdrtghomh X-ME-Proxy: Received: from april.pezone.net (p5df2ff70.dip0.t-ipconnect.de [93.242.255.112]) by mail.messagingengine.com (Postfix) with ESMTPA id 717D53061A57; Fri, 24 Jan 2020 13:01:42 -0500 (EST) Subject: Re: Allow to_date() and to_timestamp() to accept localized names To: =?UTF-8?Q?Juan_Jos=c3=a9_Santamar=c3=ada_Flecha?= , Tom Lane References: <20200124161814.GA8989@alvherre.pgsql> <32487.1579882979@sss.pgh.pa.us> <2f83150e-a2c0-6318-3125-d9b86e421aa2@2ndquadrant.com> <964.1579884408@sss.pgh.pa.us> Cc: Alvaro Herrera , Arthur Zakirov , Tomas Vondra , PostgreSQL Hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Fri, 24 Jan 2020 19:01:41 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-01-24 18:25, Juan José Santamaría Flecha wrote: > To illustrate the issue, it does not work as expected: > > postgres=# select lower(to_char(now(),'TMMONTH')); >    lower > ------------ >  ιανουάριοσ > (1 row) > > postgres=# select to_char(now(),'TMmonth'); >   to_char > ------------ >  ιανουάριος > (1 row) Well, this is interesting, because on macOS and Debian stable I get postgres=# select to_char(now(),'TMmonth'); to_char ------------ ιανουαρίου (1 row) which is the genitive of ιανουάριος. You use the genitive form for a date (24th of January) but the nominative otherwise. But the reverse mapping can only take one of these forms. So here select to_date('Ιανουαριος', 'TMMonth'); fails, which is bad. In the glibc locale data sources they have both forms listed, but apparently the API were are using only accepts one of them. (I don't know any Greek, I'm just extrapolating from Wikipedia and locale data.) -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services