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 1mpB4J-0003gC-Bl for pgsql-general@arkaria.postgresql.org; Mon, 22 Nov 2021 15:17:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mpB4I-0006e2-89 for pgsql-general@arkaria.postgresql.org; Mon, 22 Nov 2021 15:17:18 +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 1mpB4H-0006dt-TR for pgsql-general@lists.postgresql.org; Mon, 22 Nov 2021 15:17:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mpB4F-0007cz-JO for pgsql-general@lists.postgresql.org; Mon, 22 Nov 2021 15:17:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1AMFHDab3699524; Mon, 22 Nov 2021 10:17:13 -0500 From: Tom Lane To: Ron cc: "pgsql-general@lists.postgresql.org" Subject: Re: insert column monetary type ver 2 In-reply-to: <9543d6d5-2ca6-47f6-58fc-f9f79ac3fe8e@gmail.com> References: <3175389.1637427716@sss.pgh.pa.us> <6ab247a8-1524-6e55-c7fd-1d296b1584c3@gmail.com> <3443422.1637512030@sss.pgh.pa.us> <74183538-0a51-9580-87a8-8b33274c9159@gmail.com> <150ff686-0239-4700-9322-24081f054de8@gmail.com> <2A2F9174-294B-4DB4-ACF0-AC614FE94DCD@gmail.com> <9543d6d5-2ca6-47f6-58fc-f9f79ac3fe8e@gmail.com> Comments: In-reply-to Ron message dated "Sun, 21 Nov 2021 22:39:26 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3699522.1637594233.1@sss.pgh.pa.us> Date: Mon, 22 Nov 2021 10:17:13 -0500 Message-ID: <3699523.1637594233@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ron writes: > On 11/21/21 9:35 PM, Rob Sargent wrote: >> Some of us like it as an easy formatter trick for reports > to_char() can do the same, no? to_char doesn't have adequate logic for locale-specific monetary formatting. You can get it to emit a locale-specific currency symbol, but it has no clue whether that should go before or after the value. It knows nothing of other locale-specific details, such as possibly using parens in place of a minus sign. Also, the POSIX API allows monetary decimal point and thousands separators to be different from the numeric ones that to_char knows about. (I have no idea which locales use that, but I doubt they'd have put in that complication without need.) regards, tom lane