pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ron <ronljohnsonjr@gmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: insert column monetary type ver 2
Date: Mon, 22 Nov 2021 10:17:13 -0500
Message-ID: <3699523.1637594233@sss.pgh.pa.us> (raw)
In-Reply-To: <9543d6d5-2ca6-47f6-58fc-f9f79ac3fe8e@gmail.com>
References: <CAPL5KHpHSCXzB+yX4dDqKBRTtkx+M0rY7_Fc8NJnvVDw9E-iww@mail.gmail.com>
	<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>
	<af48124c-8f94-2ab8-8230-eacb66e90eed@aklaver.com>
	<e54ead7d-b3c0-f5cc-fa57-20f5799958d9@gmail.com>
	<CAKFQuwaoNoeU0m9FSZNm2ag7eBMA+p8QD8O7CNvAR0i-uTH4kQ@mail.gmail.com>
	<150ff686-0239-4700-9322-24081f054de8@gmail.com>
	<2A2F9174-294B-4DB4-ACF0-AC614FE94DCD@gmail.com>
	<9543d6d5-2ca6-47f6-58fc-f9f79ac3fe8e@gmail.com>

Ron <ronljohnsonjr@gmail.com> 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





view thread (21+ messages)  latest in thread

Message-ID: <3699523.1637594233@sss.pgh.pa.us>
Permalink:  ../3699523.1637594233@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3699523.1637594233@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ronljohnsonjr@gmail.com
  Subject: Re: insert column monetary type ver 2
  In-Reply-To: <3699523.1637594233@sss.pgh.pa.us>
  References: <CAPL5KHpHSCXzB+yX4dDqKBRTtkx+M0rY7_Fc8NJnvVDw9E-iww@mail.gmail.com> <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> <af48124c-8f94-2ab8-8230-eacb66e90eed@aklaver.com> <e54ead7d-b3c0-f5cc-fa57-20f5799958d9@gmail.com> <CAKFQuwaoNoeU0m9FSZNm2ag7eBMA+p8QD8O7CNvAR0i-uTH4kQ@mail.gmail.com> <150ff686-0239-4700-9322-24081f054de8@gmail.com> <2A2F9174-294B-4DB4-ACF0-AC614FE94DCD@gmail.com> <9543d6d5-2ca6-47f6-58fc-f9f79ac3fe8e@gmail.com> <3699523.1637594233@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