Re: function to_char

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Fontana Daniel C(dot) \(Desartec S(dot)R(dot)L(dot)\)" <desartecsrl(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: function to_char
Date: 2021-04-17 15:09:53
Message-ID: 256548.1618672193@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Fontana Daniel C. \(Desartec S.R.L.\)" <desartecsrl(at)gmail(dot)com> writes:
> Example, select length (to_char (1, '990'))
> returns 4 because?

Per the fine manual:

* If no explicit provision is made for a sign in to_char()'s pattern,
one column will be reserved for the sign, and it will be anchored to
(appear just left of) the number. If S appears just left of some
9's, it will likewise be anchored to the number.

If you don't want to leave space for a sign, it looks like FM is
the only way to do that.

regards, tom lane

In response to

  • function to_char at 2021-04-17 15:03:02 from Fontana Daniel C. (Desartec S.R.L.)

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-04-17 15:16:11 Re: BUG #16969: INSERT of multiple rows into GENERATED ALWAYS AS IDENTITY column with DEFAULT value is broken.
Previous Message Fontana Daniel C. (Desartec S.R.L.) 2021-04-17 15:03:02 function to_char